Hacker News new | past | comments | ask | show | jobs | submit login
Racket v5.3 (racket-lang.org)
115 points by shawndumas on Aug 7, 2012 | hide | past | favorite | 50 comments



I've started writing Clojure code for production at Chartboost, and I'm absolutely loving the language. However, its basis on the JVM is a major downer. I decided to go with it over other lisps due to the practicality of the massive standard library, plus some neat language features.

How does Racket compare?

- Specifically, is the standard library + the stuff available through the PlaneT package manager enough to get by with? How's the community? IRC channel, documentations, etc.?

- How does the language compare when it comes to Clojure's neat features? Atoms, keywords, native syntax for vectors or hashes…

Edit: I also forgot to ask: how's performance? It's a compiled language, right?


I'm a Racket newcomer (before that I used Common Lisp as my primary Lisp).

The standard library is great. It has a lot of built-in functions/macros that abstract many common Lisp paradigms, similar to what Alexandria was meant to do, but much better (in my opinion). Recently, I was working on a Racket implementation of a project that I'd originally wanted to do in Common Lisp, and I felt practically cheated that so many of the 'hard' parts were compositions of one or two Racket standard functions.

Take a look at the Racket homepage; one of the 'Hello, World' examples on rotation is a web server in ~5 lines of clean, readable Racket.

The community is among the best I've seen in programming languages (IRC channels, etc). Very friendly and helpful.

Documentation is very well-done. My only complaint is that I do have a bias against languages without a strong culture of providing example code in the documentation. Some libraries do this better than others. Overall, I'd say it's far better in this regard than Java and Haskell, but not as good as Python. (I understand that this is also a matter of language design; some languages need this more than others).

As far as Clojure's 'features', I've never found myself a fan of the additional syntax, but if you ask me, Racket solves this problem in a far better way: scoped sub-languages.

Lisp's biggest asset is its ability to create other languages (and other syntaxes) so easily; Racket provides an unbelievably clean way of abstracting this and even mixing code between two dialects. For example, I find myself using Typed Racket (a strongly typed dialect with static type checking), but some functions are only implemented in other dialects. That's no problem; I can mix modules written in different dialects in a fairly straightforward manner.

For me, this was the killer feature that convinced me I needed to start using Racket. Yes, this is possible in Common Lisp (what isn't?) but Racket already had a large and accessible community built around this.

So, if there's anything you miss from Clojure, chances are good that you'll be able to find what you need, between the scoped dialects and well-designed libraries, not to mention Lisp's own powerful tools for recursively defining language features on-the-fly.


It is all there. See for yourself:

http://docs.racket-lang.org/guide/index.html

Nice features: Racket programs run without change on Windows, OS X, and, Linux. The GUI library binds to native backends so everything looks native.

The documentation is very nice.

Got any question? Ask the mailing list or on IRC. http://racket-lang.org/community.html


I haven't looked at Racket in a long time. Is it possible to make standalone executables? That's one of the reasons I've used Chicken Scheme (http://www.call-cc.org/) for many cross-platform projects with easy deployability.


There is support for packaging programs to run on machines that does not have Racket installed. I haven't tried it for years, so I can't give details. Try it out:

http://docs.racket-lang.org/guide/intro.html?q=executable...



What about the JVM is such a downer?


The only downers I care about are stack traces in "Java" rather than Clojure and the lack of TCO in the JVM.

I think there's some work going on to address the former. The latter issue isn't really that bad unless you need to use trampoline, which I don't care for because it means the functions have to be written to know they'll be used in this way.

Regardless, Clojure is one of my favorite languages.


Nothing really. I think it is just a preference thing. If I don't have to install Java then that is one less thing to install I guess.


Even though OSX Mountain Lion makes it simple to install Java (click yes on first use), it's one less OS that comes with it preinstalled.

Also, the slower startup time of the JVM affects clojure apps and makes simple command line scripts in clojure less attractive


This is not exactly true. The JVM startup time is not what makes Clojure slow to load; it's the startup of Clojure itself.

    ~$ time clj test.clj 
    Hello world!
    
    real    0m1.337s
    user    0m1.309s
    sys     0m0.172s


    ~$ time java Test
    Hello world!
    real    0m0.142s
    user    0m0.116s
    sys     0m0.030s
You may want to look at the -XX:+TieredCompilation -Xbootclasspath flags. They reduced the clojure startup significantly for me.


I really love Racket/Lisp. But I wish I had more of a use for it. Probably the most beautiful language I used during my undergraduate days.


Have you looked at Clojure?


JOOC, what big companies are using racket-lang? This is the first time I heard of it.


It is also used by Y Combinator (Hacker News is programmed in Arc and the Arc language runs on mzscheme, which is Racket's core).


Last year, someone from Naughty Dog gave a talk at CUFP about using Racket: http://cufp.org/conference/sessions/2011/functional-mzscheme...


Don't know of big companies, but it used to be called PLT scheme. It's known for it's huge-ass standard library (batteries included style) and being used as an educational tool in a bunch of big tech schools in the US.


Not only in the US actually, it is used in Germany and France too, at least.


Not a big company, but Northeastern University's CS department uses it in their intro course to computer programming. The staff there is all about PL research and I believe they use it pretty extensively in that regard.

I spent a semester there and the staff are hardcore into it. I learnt a lot from Olin Shivers (http://www.ccs.neu.edu/home/shivers/) and he used Racket extensively.


That's largely due to the presence of Matthias Felleisen, who (AFAIK) spearheaded Racket.


Understatement. A good fraction of the pl dudes there work on racket, and they have One of the largest active pl groups in the us if not the planet


Brown University's accelerated intro CS class only uses Racket (http://www.cs.brown.edu/courses/csci0190/2011/). Beautiful language. Everything in the language, including basic core functions, can be built only using lambda


You know that "Racket" is the former "PLT Scheme", right? Some boutique consultants use it, notably Untyped: http://untyped.com/


I heard that Untyped and Well Typed tried to set up a corporate softball league, but they couldn't agree on a ruleset to use.


It's also used at the University of Waterloo in Canada for their first few CS courses.


I don't know of any (and I dont think there are any), unless you accept major educational institutions as a substitute for big companies.

I keep waiting for Racket's day to come, because it is a really great system.


Perhaps they are using it as a 'secret weapon' and not talking about it?

Wouldn't surprise me.


Me either. I hope not, though. Lisp is entirely too anti-social.


Relevant and required lisp reading: http://www.lambdassociates.org/blog/bipolar.htm


Such a good essay!


I'm confused: Is racket a fully-compliant scheme? If not, which scheme should I use? And, what is racket?

I could not quite find that information on the Wikipedia/website.


Scheme is so old that there is not one language but rather a family of dialects that are considered Schemes. The Scheme community has several times made a standard on the parts of the language(s) that various implementors can agree on. The standard is small though. All the major Scheme implementations come with many language constructs and libraries not covered by the standard.

Racket started as a Scheme but changed name to Racket a few years ago to signal that the racket language is much more than plain standard Scheme. One remarkable thing about Racket is the that the module system allows implementing other languages as modules with relative ease. Included in the Racket distribution is therefore an implementation of R6RS (and R5RS) the most recent standard (R7RS is coming soon).

Also included is implementation is a typed version of Racket, an implementation of a logic programming language and, yes your eyes are not deceiving you, Algol 60.


EDIT: soegaard's explanation above is more thorough

AFAIK, Racket the language is somewhat a fork of Scheme, but the Racket environment can run different languages (one of which is 'standard' Scheme).


I think racket has all the way up to r6rs but much much more. Racket itself is an implementation of the standard, a GUI, a compiler / interpreter, a standard library and then some all rolled into one.


The futures visualizer sounds awesome! Do other languages have parallel-debugging tools like that?


GHC has ThreadScope.


How do you integrate Racket with emacs? Is it similar to Clojure?


Most(?) people use DrRacket.

For the Emacs fans: http://docs.racket-lang.org/guide/Emacs.html?q=emacs

I used to use Emacs, but switched to DrRacket several years ago. It is easy to underestimate DrRacket. Tools like Check Syntax which allows scope respecting renaming of identifiers are one of the benefits of using DrRacket.

I also enjoy being see graphical results directly in the REPL. For example plots. http://docs.racket-lang.org/plot/intro.html?q=plot


I always have mitigated feelings about these tools. On the one hand, those features are really appealing. On the other hand, leaving my regular editor prevents me from using its (sometimes heavily configured) text- and code-editing capabilities. Plus I can access all the code I've written for other projects from Emacs, regardless of the language.


That's my concern as well and the reason I went through a bit off an ordeal getting Clojure into emacs, as opposed to falling back on a Clojure editor.


I just have an Emacs open in another windows that I can switch to if I need to edit something non-Racket.


We use Geiser[1].

[1] http://www.nongnu.org/geiser/


Thank you, I'll give it a go.


I can see "submodules" being a handy feature.


Good to see the json library is in there now. That being missing was a minor annoyance earlier.


Does racket have real threading? Will it use multiple cores?


There are two features that take advantage of hardware parallelism: futures & places, which work at different granularities. You can find the guide entry on them here: http://docs.racket-lang.org/guide/performance.html#(part._ef...

There are also green threads for concurrency: http://docs.racket-lang.org/reference/concurrency.html


Does it work on ARM?


Yes, it does. The JIT compiler doesn't work on ARM, but otherwise it's fine. This blog post explains how one person got Racket on an Android phone w/ARM: http://www.wedesoft.de/racket-on-android.html


Thank you!




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: