4 ms·
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 decid
by SeoxyS 14y ago
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?
- prospero 14y agoWhat about the JVM is such a downer?
- sigzero 14y agoNothing 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.
- autodidakto 14y agoEven 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
- ruggeri 14y agoThis 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.
- pivo 14y agoThe 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.
- soegaard 14y agoIt is all there. See for yourself: http://docs.racket-lang.org/guide/index.html 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 http://racket-lang.org/community.html
- DASD 14y agoI 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/ http://www.call-cc.org/) for many cross-platform projects with easy deployability.
- soegaard 14y agoThere 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&q=plot#(part._.Creating_.Executables) http://docs.racket-lang.org/guide/intro.html?q=executable...
- kd0amg 14y agoUse raco exe http://docs.racket-lang.org/raco/exe.html http://docs.racket-lang.org/raco/exe.html
- chimeracoder 14y agoI'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.
- deleted 14y ago[deleted]