9 ms·
Am I the only one who forgets Racket? Everytime I visit the site and browse through the documentation, I find myself wondering why I'm not using the language.
by DASD 14y ago
Am I the only one who forgets Racket? Everytime I visit the site and browse through the documentation, I find myself wondering why I'm not using the language. Years ago I used Chicken Scheme but this seems more robust and the standard library is adequate. Who's using this in production? What's your experience?
- maximilianburke 14y agoHN uses Arc which is based on MzScheme/Racket, IIRC.
- wglb 14y agoDoes it work with later versions of MzScheme or Racket?
- waterhouse 14y agoYes. The main problem with MzScheme v4.0 and higher, and with Racket, is that cons cells were made immutable by default. This was hacked around in Arc 3.1: http://ycombinator.com/arc/arc3.1.tar http://ycombinator.com/arc/arc3.1.tar The fix is not quite perfect; occasionally it may cause problems. (Bwahaha.) Do consult the following page, which has a link to a description of a proper fix: https://sites.google.com/site/arclanguagewiki/arc-3_1/known-bugs-and-gotchas https://sites.google.com/site/arclanguagewiki/arc-3_1/known-...
- tikhonj 14y agoWell, I haven't used it in production, but I used it for a research project last semester. It was actually pretty good, and there are definitely some very nice features. The standard library was pretty good except it missed some functional features I wanted like immutable vectors (or even just functional operations on mutable vectors). The language is extremely flexible, and you can take advantage of this to write some really elegant and maintainable code. It's one of the more productive languages I've used--of the languages I've used extensively, it's better than JavaScript, Java or Python. So I liked it quite a bit over all. However, it doesn't quite clear the threshold where I would use the language voluntarily. I thought it had lackluster support for functional programming, especially from what is supposed to be a functional language. This was evident in the library (e.g. the lack of immutable vectors and the like) and also in the way certain pretty fundamental structures (like ports) worked. Also, for a dynamically typed language, I thought it had too many different types. It was too easy to get mixed up between bytestrings and strings, for example. It was also not obvious when you should use or expect nil vs #f. That said, the features for creating your own types (mostly structs) were very good--I found they were very lightweight but still flexible enough to be useful. I am actually a big fan of the syntax. Not just the s-expressions (although, with paredit, they are pretty awesome) but also the reader macros. That said, I'm also rather partial to infix operators, which are obviously not present. So over all, it's a great language. However, I would still choose Haskell or OCaml over it for virtually any project. The main exception would be projects very heavy on metaprogramming, where Racket really shines.
- javert 14y agoHowever, I would still choose Haskell or OCaml over it for virtually any project This might be off-topic, but I've been thinking about learning one of these two. Can you give me any advice on which to learn first (or which to use for what)?
- tikhonj 14y agoWell, I'm a little biased, but I would learn Haskell. It's the one I learned first--in fact, I learned it during my very first college CS course. (The course, coincidentally, was in Scheme.) If I managed it as a freshman, it can't be all that difficult :P. Haskell has a couple of very good freely available books: Learn You a Haskell[1] and Real World Haskell[2]. I also found Write Yourself a Scheme in 48 Hours[3] very helpful. When I was learning OCaml, I could not find any terribly good resources. That said, it wasn't much of an issue, so I didn't look too hard--learning OCaml after knowing Haskell is very easy. There is going to be a Real World OCaml book at some point, but I think it's still a work in progress. [1]: http://learnyouahaskell.com/ http://learnyouahaskell.com/ [2]: http://book.realworldhaskell.org/ http://book.realworldhaskell.org/ [3]: http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_H... I also think Haskell is good because it's more of a departure from languages you're probably used to. You can't sink back into your old habits, because everything is done completely differently. Of course, some people find it helpful to have less of a departure from what they're used to, so perhaps you might prefer OCaml because it's less different from normal languages. I use Haskell for my own projects (and, this semester, for research), and I used OCaml for an internship this summer. I think that for most tasks, they're roughly equally suited. If you want to do multicore concurrent or parallel code, I think Haskell has the edge, but I have not really done much of that in either language. OCaml has a very good JavaScript compiler called js_of_ocaml[4]. While Haskell does have some options for JavaScript as well like Fay[5] or UHC[6], I don't think it's quite as nice. I used js_of_ocaml during my internship and was very happy with it. So for web stuff, I'd probably go for OCaml. Both OCaml and Haskell have good backend web frameworks, but I haven't really used any of them. [4]: http://ocsigen.org/js_of_ocaml/ http://ocsigen.org/js_of_ocaml/ [5]: http://fay-lang.org/ http://fay-lang.org/ [6]: http://www.cs.uu.nl/wiki/UHC http://www.cs.uu.nl/wiki/UHC If you happen to be on windows, installing OCaml is a pain. Haskell, with the Haskell Platform[7] should be much easier, but I haven't tried it myself. [7]: http://www.haskell.org/platform/ http://www.haskell.org/platform/ OCaml has a really good Emacs mode called typerex[8]. Haskell has some alternatives like ghc-mod[9] and scion[10], but I've never been able to get them to work. Admittedly, typerex was not easy to install either. [8]: http://typerex.org/ http://typerex.org/ [9]: http://www.mew.org/~kazu/proj/ghc-mod/en/ http://www.mew.org/~kazu/proj/ghc-mod/en/ [10]: https://github.com/nominolo/scion https://github.com/nominolo/scion Ultimately, you wouldn't go wrong with either one. Moreover, the core ideas are fairly transferable between the two: you'll find that learning OCaml after Haskell or Haskell after OCaml is relatively easy. I would lean towards Haskell, but it's not a big deal. I just realized that I've written a whole bunch of paragraphs to say very little: either language is a great choice and I just happen to like Haskell more. Hopefully this is not too much of a deluge of information :P.
- takikawa 14y 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 http://en.wikipedia.org/wiki/Starfire_Optical_Range [2]: http://cufp.org/archive/2006/abstracts.html#RichardCleis http://cufp.org/archive/2006/abstracts.html#RichardCleis [3]: http://cufp.org/videos/functional-mzscheme-dsls-game-development http://cufp.org/videos/functional-mzscheme-dsls-game-develop... [4]: http://www.slideshare.net/naughty_dog/statebased-scripting-in-uncharted-2-among-thieves http://www.slideshare.net/naughty_dog/statebased-scripting-i...
- waterhouse 14y agoI use it to run Arc, which I use as my go-to general-purpose programming language. I use it to do math, Project Euler problems (not exactly the same thing), sometimes to control the computer [I sometimes run programs that click the mouse for me, and used to make it type as well], to generate repetitive code[1] for usually experimental purposes, and occasionally to make complicated projects like a sudoku solver, or a thing that reads and writes WAV files. Racket is pretty good, is pretty fast. It can add the integers from 1 to 100 million in 407 milliseconds on my machine. If you need incredibly speedy numerical code, it is still possible to load machine code, perhaps from a C dynamic library, and run it. My main objection is that it doesn't have real-time garbage collection. We'll see about that. [1] Don't get excited, I haven't written a compiler or a working assembler (yet). I mean things like this: (pbcopy:tostring:on x '(rax rbx rcx rdx rdi rsi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15) (prn " " "mov [rel teh_end + " (* index 8) "], " x)) --> clipboard now contains the following: mov [rel teh_end + 0], rax mov [rel teh_end + 8], rbx mov [rel teh_end + 16], rcx mov [rel teh_end + 24], rdx [...]
- noelwelsh 14y agoI'm using Racket right now to develop a machine learning algorithm. The new math and plot libraries are absolutely fantastic. For the brave or foolhardy it makes a viable alternative to R, NumPy, or Julia. (I haven't used Julia. I have found NumPy impossible to install. I want to punch something every time I use the steaming mess that is R.) Racket is far more a real language than the alternatives in this space but it lacks their wide range of numeric libraries. Racket is also a really interesting language to learn. Nothing else does meta-programming like Racket, or mixes typed and untyped languages (see Typed Racket). However the most fun I've had with Racket is writing machine code directly into memory and executing it straight from Racket.
- xradionut 14y ago"I have found NumPy impossible to install." Try using one of "mega" bundles from Enthought or Continuum. Anaconda CE installs easily on Windows and Linux.
- deleted 14y ago[deleted]
- dingfeng_quek 14y agoI used to use Racket in production and prototyping (few years ago), as a "glue language" and "business-logic" for a web-app, for the parts that are not IO, memory, compute intensive, etc. My metrics for language choice are: 1. Simple to learn and remember (they tend to correspond) 2. Module System; Support for modularization of complexity 3. Simplicity of coding and maintaining simple modules 4. Simplicity of coding and maintaining complex modules 5. Available libraries and their quality In comparison to (I can only code efficiently in) Java, Python, Javascript/CoffeeScript/Node, Common Lisp, Scheme, and Haskell - Racket is best for 2. (especially if you add a bit of meta-data to a module) and 4. - Racket is much better than Haskell, Java, and Common Lisp for all 5 metrics Except for Haskell, which happens to be very nice for certain things that benefit from its type and class system - For 3., Racket is overly complex, especially with the macro facility and huge number of types and structures. Node/Javascript/Coffee is better by far; Python is a little better than Racket because of less language features - Racket is weak in 5. - Racket has many libraries of dubious quality, and I've hit undocumented issues a few times; Only Java was worse; However glue/business-logic doesn't require many libraries I now use NodeJS because I've been dealing with simpler stuff.
- pekk 14y agoI haven't used Racket, though it looks cool. Since you are conversant in a few languages, I'd like to pick your brain if I can: What do you think Racket could do to improve (particularly 5)? And what could other languages learn from Racket's module system?
- dchest 14y ago"I Write Like"[1] runs on Racket on a VM with 256 MB RAM. [1] http://iwl.me http://iwl.me, source code: http://www.codingrobots.org/p/iwl/ http://www.codingrobots.org/p/iwl/
- mebassett 14y agoI don't know if this counts as in production, but we use racket extensively on my team (we do predictive market simulations). I wish I could give you a deep technical reason why racket works where nothing else would do - but the truth is that I'm the one who picks the technology, and I like writing code in racket. biggest problems thus far are 1) the lack of external libraries (exempli gratia, nothing like python's boto for talking to ec2), but you probably saw that one coming. and 2) the language is almost too big, with too many datatypes: without even mentioning macros (which racket does quite well), the class/object system, the functional and mutable datatypes, contracts, pattern matching, typed racket, et cetera, can keep you pretty busy. Myself and the others might not just know racket well enough yet, but it's easy for one person to write unreadable code without ever leaving standard language constructs. But this is also the best thing about racket - the language is flexible enough that you can find a natural way to express whatever you need to. We've also been playing with distributed places (racket processes on remote machines) with some success, too.
- muyuu 14y agoThis is exactly how I feel and a similar background, though I used Gambit and Bigloo more than Chicken. I wonder how many people are in this situation.
- outworlder 14y agoWell, 'years ago' is a long time. You'll probably find out that Chicken has evolved a lot since then. As has the list of available eggs.
- greyfade 14y agoI'm not affiliated with them, but I know Naughty Dog, the developers behind the Uncharted series, Jak and Daxter, Crash Bandicoot, and the upcoming The Last of Us, have long used Lisp dialects in all their games. The game engine driving Uncharted uses a port of MzScheme for the majority of their development pipeline and game logic. They've talked about how it improves their workflow for years. You can find some of their articles and presentations if you look for references to GOAL (game-oriented assembly language) and GOOL (game-oriented object language), their in-house Lisp dialects.