HN user

takikawa

42 karma
Posts0
Comments29
View on HN
No posts found.
Why Go? Use Racket 13 years ago

but looking through the docs on typed racket it certainly looks like it adds java-style static typing

It's unclear what you mean by "Java-style static typing" then, because the Java type system and Typed Racket's type system are completely different.

One actually has local type inference (which is not "crappy" type inference necessarily; HM-style type inference is notoriously brittle), the other doesn't. One has nominal class types, the other has no class types (yet). One has intersection types, occurrence typing, "true" union types, and so on, while the other has none of those. One has bounded polymorphism, the other has System F-like polymorphism. One of them has variable-arity polymorphism, while the other doesn't. The list goes on.

In fact, aside from being explicitly typed, there are few similarities.

Why Go? Use Racket 13 years ago

Typed Racket definitely doesn't add a "Java-style static typing" system at all. Its type system is quite specifically designed to accommodate the kinds of programming idioms you find in Racket programs (via occurrence typing, function intersection types, and so on), and comes with local type inference.

Racket is really very complex thing with many man-decades of research behind it and even where it is being advertised, it looks like a typical "academic" thing.

As a fellow Racketeer, I'm curious: what do you think can be done to shake this "academic" image?

It does[1], but it's not necessarily preferred. The whole point of Typed Racket is that you can write your program in (untyped) Racket originally (maybe starting out as a small script), and then add types if you need your program to be more robust. Since typed and untyped modules interoperate smoothly, you choose whatever combination works for your project.

That said, some libraries start out typed too (e.g., the Racket math library[2]) and do benefit from type-driven optimizations and type-checking.

[1] http://docs.racket-lang.org/ts-guide/ [2]: http://docs.racket-lang.org/math/

I use emacs with evil-mode (very good vim emulation) to program in Racket. The advantage of emacs is that it has paredit, geiser, and other useful plugins.

and a better abstract model for macros than even Racket's stellar syntax-parse.

To clarify a little bit, `syntax-parse` is actually not its own model for macros but is a sophisticated front-end for Racket's underlying macro system (described in this paper: http://www.cs.utah.edu/plt/publications/jfp12-draft-fcdf.pdf). Also see Jay McCarthy's blog article that tries to clarify this: http://jeapostrophe.github.io/2013-07-22-123list-post.html

Racket's macro system and Kernel's fexprs are pretty fundamentally different, so I don't think the comparison is very apt. In particular, Racket's macros can be entirely compiled away.

and Typed Racket seems to be going nowhere.

To the contrary, Typed Racket is under active development and new Racket libraries are written using it. I don't know where you got the impression that it's going nowhere, but it's incorrect.

Racket v5.3.2 13 years ago

> Who's using this in production?

Here are two examples that have been presented at CUFP. The Starfire Optical Range[1, 2] uses it in production, I think as part of the control software for their telescopes. Naughty Dog, a major video game developer, uses it for scripting their games[3, 4].

[1] http://en.wikipedia.org/wiki/Starfire_Optical_Range [2]: http://cufp.org/archive/2006/abstracts.html#RichardCleis [3]: http://cufp.org/videos/functional-mzscheme-dsls-game-develop... [4]: http://www.slideshare.net/naughty_dog/statebased-scripting-i...

> Now, admittedly, not all the productivity gain is from types. However, they certainly help me, not just in making the code robust but also in writing it in the first place. And typeclasses actually do make the language concretely more expressive in certain ways.

You said you started out in Racket. Did you try Typed Racket? You don't necessarily need to move to Haskell to get a type system (though you won't get typeclasses).

> AFAICT there is not a well-understood definition of first-class outside of "first-class functions."

Why not just the same notion of "first-class" as functions? In other words, that the feature is actually represented by a run-time value that can be passed around freely and stored. This is the usual definition of "first-class" that I hear most people use in the programming languages world. Examples include first class control (continuations), first class references (boxes, mutable cons cells, etc.), first class environments, first class modules (see OCaml, units, etc.), first class labels, and so on.

In Racket, any custom data type can be turned into a function by using the `prop:procedure` structure type property. It's usually not done with things like maps and sets because this kind of "punning" is not idiomatic. Being a function is not actually a necessary condition for being "first-class" though.

The Nature of Lisp 14 years ago

That's not a problem though: delimited continuations are more expressive than undelimited ones anyway and often are a more natural way to solve programming problems.

Probably the best way to learn what an evaluation context is to read the book you've linked to there. Alternatively, it's basically what the Racket reference section on the evaluation model calls a "continuation": http://docs.racket-lang.org/reference/eval-model.html

We do try hard to make the docs understandable though, so if you have some feedback please do mention it on the mailing list so that the responsible devs can try to address it.

The title is misleading since the blog author admits to not having tried Racket recently. IMHO, Racket fixes the author's key complaint about documentation by having a Guide (separate from Reference) with many examples: http://docs.racket-lang.org/guide/index.html

Since Racket isn't Scheme, it also comes with more data structures built-in and there's on-going work to better support numerical computation.