4 ms·
In CLs, anyways. In Schemes, we usually only have 1 and 3. Maybe 2 and four, but only sometimes.
by qwertyuiop924 10y ago
In CLs, anyways. In Schemes, we usually only have 1 and 3. Maybe 2 and four, but only sometimes.
- nickpsecurity 10y agoThe Scheme I was thinking of using to re-learn LISP and Scheme was Racket. Its environment + How to Design Programs looked like a strong combo. Do you know how it fares on this list?
- dleslie 10y agoFWIW, Racket explicitly dropped Scheme from its branding because the language designers disagreed with the direction of Scheme and wanted to go their own way; and they have, to a great extent. Racket has scheme in its syntax, but as does C++ has C.
- nickpsecurity 10y agoAhh. So probably best to think of it as its own, Scheme-like language.
- qwertyuiop924 10y agoIndeed: Beneath some syntactic similiaries, the semantics and idioms of the languages are radically different.
- nickpsecurity 10y agoDarn. So, HtDP and The Little Schemer keep being posted as good intros. What your pic on best Scheme and into text to use to get started in a way where foundation knowledge will keep paying off vs non-standard dialect?
- qwertyuiop924 10y agoTeach Yourself Scheme in Fixnum Days (http://ds26gte.github.io/tyscheme/ http://ds26gte.github.io/tyscheme/), SICP, The Scheme Programming Language 3rd edition (the forth edition is about the much maligned R6RS, which isn't well supported) (http://www.scheme.com/tspl3/ http://www.scheme.com/tspl3/), and the Scheme Wiki (although it's a bit out of date) (http://community.schemewiki.org http://community.schemewiki.org) are all helpful resources. In addition, the Scheme reports are small enough that you can read them cover to cover for a full coverage of the base language (save the very long R6RS), although there are some things left intentionally undefined (an error, for example, can do anything from raising an exception to crashing your program, or anything in between). The most popular standards are R5RS (http://www.schemers.org/Documents/Standards/R5RS/ http://www.schemers.org/Documents/Standards/R5RS/) and R7RS, (http://trac.sacrideo.us/wg/wiki/R7RSHomePage http://trac.sacrideo.us/wg/wiki/R7RSHomePage). Pretty much all Scheme implementations are at least mostly compliant with one of them, if not entirely so. Because Scheme is so minimal, pretty much every implementation extends the language in non-standard ways. The difference between this and what Racket does is that other implentations still honour the standard, merely extending rather than altering, and usually extend a bit less dramatically. As such, your implementation's documentation is an important resource. The most important language extension is macros: imperative macros aren't part of any spec save r6rs. Most schemes opt to implement er/ir macros, sc/rsc macros, or syntax-case. er macros are the simplest and closest to standard defmacros, but you have to rename functions as well as variables, so it gets hard to see what's going on pretty fast. ir macros fix this, but are O(n) when implemented in terms of er, which they usually are. This is the system Chicken uses. sc/rsc are probably the best system. They're based around syntactic closures, and it takes about five minutes to learn the basics. Chibi and MIT Scheme use it. syntax-case is akin to Racket's macro system, and unifies pattern matching and procedural macros. Some love it, others think it's an overcomplicated mess. Guile and other R6RS (or partially R6RS) compliant Schemes use this. There are some widely ported code libraries that you may wish to use, in addition to those specific to your implementation. SLib, SXML, the descendants of TinyCLOS (there are many), irregex, matchable, the various loop macros (there are several), and the awk macro are all useful tools. Of special note are the SRFIs: Scheme Requests for Implementation. They're optional standards for extensions to the Scheme language and also libraries, and Scheme's equivalent of RFCs. Typically, implementations will include a selection of the more popular SRFIs in their stdlib, and sometimes more in their package repositories, if they have one. SRFIs are required to provide portable implementations if at all possible, which is usually is. However, it is sometimes possible to write better optimized code using implementation specific features, so if there's an implementation specific implementation of a SRFI, choose it over the standard one. SRFIs are usually referred to by number, which confuses everybody. You can find them all on http://srfi.schemers.org http://srfi.schemers.org. the most important ones for new users to know are probably srfi-1 (list manipulation functions you'd expect to be in the core language but aren't), srfi-13 (string manipulation), and srfis 69 and 125 (hash tables: 69 is older and more rudimentary, but extremely widely supported. 125 is new, will become part of R7RS large when it's finished, and is fully backwards compatible with 69, but provides additional convenience functions). Finally, there's choosing an implementation. Here's a summary: -MIT Scheme: it's frozen, and essentially only on life support. Use it for doing SICP, if at all. -Guile: bytecode compiled. One of the best Schemes for getting Real Work done: a bit lacking in libraries, but has a good FFI, and the libraries it does have are of excellent quality. Very well documented, with friendly developers (the lead, Andy Wingo, is a great guy, and his blog is worth a read no matter what Scheme you pick) and a good community. It's R5RS, with some R6RS support. The only Scheme I know of to support native threads. Also good for dynamic linking into applications as an extension language. -Chicken: My personal favorite. R5RS, working toward R7RS, relatively conservative, extension-wise. Also an excellent choice for Real Work. Compiles to C, quite fast. It has a large package repository (for a scheme): probably the largest of the schemes on this list, including a web framework (guile as one as well), as well as countless other useful things. Because it's C compiled, the FFI is dead simple. Also uses Cheney on the MTA compilation, so continuations are fast enough to practical in real work, whereas they're mostly toys in other schemes. Notably, it's not re-entrant (necessarily), and doesn't support OS-level threads. -Gambit: Also compiles to C. Probably the fastest of the Schemes in the general case. Has some libraries (SchemeSpheres, among others), but not many, so be prepared to write a lot of FFI code, and code that would otherwise be provided by libraries. Has coroutines like Chicken, and also has a message-passing library/system akin to erlang called termite. R5RS. -Chibi: Written by Alex Shinn, the author of many scheme packages, including irregex, the most common regex package on the Schemes. The reference implementation of R7RS. Has a package repository through Snow: better than Gambit, not as good as Guile or Chicken. Very small, bytecode compiled. Has a small stdlib with some neat stuff in it. Has a decent FFI, but not as good as Chicken or Gambit. Built for static linking into an application. Welcome to Scheme. Sorry for the infodump, but I hope it helped.
- qwertyuiop924 10y agoNot really. I'm pretty sure Racket is bytecode compiled, but it's not nativecode compiled. It has a realtime interpreter, of course. I'm more of a Chicken fan, myself, and Chicken has a REPL/interpreter and an optimizing compiler. It's compiler isn't especially fast, even at lower settings. Racket really is the C++ to Scheme's C in that it's similar to its parent (although unlike C++, it's actually not compatible), and is more complex (I would say too complex, but unlike C++, it's fairly well designed, so it's a matter of opinion: if you like it, good on you). Guile is also bytecode compiled. I don't know how fast compilation is.
- soegaard 10y agoRacket can compile a racket source file to platform independent bytecode (stored as zo-files). When the bytecode is run, it isn't interpreted, but a just-in-time compiler kicks in, generates machine code, and the code is run. As far as I know - a new compiler is in the works.
- dleslie 10y agoChicken can be configured for the different levels of optimization it will do; now I wouldn't call it fast...
- qwertyuiop924 10y agoLike I said: it has 1 and 3.
- dleslie 10y agoI have high hopes for the next major release; it's shaping up to be a significant improvement across the board.
- qwertyuiop924 10y agoI am subbed to the mailing list. I must have missed that. What's coming? I know I was really exciting about the debugger (feather) in the previous release.