4 ms·
Scheme is a standard. The most common standards for Scheme are R5RS, the controversial R6RS, and R7RS, which hews closer to R5RS. While there are reference impl
by qwertyuiop924 10y ago
Scheme is a standard. The most common standards for Scheme are R5RS, the controversial R6RS, and R7RS, which hews closer to R5RS. While there are reference implementations, there isn't really a vanilla implementation, as even the references add their own tweaks. Here's why:
Until R6RS, having a "vanilla" scheme wasn't practical: the scheme standard is minimalist, and excludes things like binary IO, modules, networking, OO, etc, although it does provide the tools to make your own module/OO system if you want. Writing portable scheme is almost impossible, and frowned upon.
R6RS tried to extend the language and stdlib, so that writing portable scheme was possible. It was criticized for being overly complex, and for forgoing common SRFIs (informal standards that can be implemented across schemes), instead coming up with its own solutions to the same problems. Its acceptance was mixed. Guile implements some of it, but there are few full implmentations of the standard. The lack of acceptance for R6RS is sometimes seen as one of the catalysts to PLT Scheme casting off the anchors of the Scheme standard, and renaming itself Racket, which was already starting to happen, as PLT steadily deviated from the standard.
R7RS was an attempt at a compromise: it provided the "small" language, already published, which is more based upon R5RS, and adds a module system and a few other extensions. The "large" language, still in development, will provide a large stdlib for doing Real Work. It will, however, notably lack a few things, such as an FFI, so while portable scheme will be possible, not all code will be portable (nor, I think, will all code ever be). Thus far, it seems to be going fairly well, with CHICKEN and Guile, some of the most popular scheme implementations, planning to support it.
Probably the closest thing to a vanilla scheme is Chibi Scheme, the reference implementation of R7RS. It's small, lightweight, and designed for static linking and embedding, like Lua. It has its extensions, of course, but they're fairly minimal.
- AceJohnny2 10y ago> Writing portable scheme is almost impossible, and frowned upon. Jesus christ. I'm sure there are great, rational reasons for this. What were they? It's really interesting to think that the majority of our software platforms are A) Unix-derived and a bit of B) Windows, and both of those have pretty much taken over industry with Algol-derivatives (C, C++, Objective-C, Java...). I mean, it's news when a company says "We don't use the above!" With that in mind, it feels like Scheme is the like the Basques/Finns of the software world, a completely separate genealogical line that perdures to this day in small pockets here and there.
- ThatGeoGuy 10y agoDo keep in mind portable here is with regards to "between implementations" and not "per platform." Code between PyPy and CPython isn't guaranteed to be 100% portable (although they try), and in Scheme it's much the same way. And you shouldn't think in terms of C, C++, etc being portable. There's lots of code written for GCC that doesn't conform to an explicit C++ standard (C++11/14 try to change this, but still). In the same way, you're really writing to the standard of language your C/C++ compiler implements. It's hairy, but the fact that things are not portable is just given more visibility in Scheme. Reasons for this are probably varied, but it also has to do with the variation in how Schemes are implemented at the lowest level (think Guile vs. CHICKEN, just in terms of GC they're worlds apart). At the end of the day, some code can be written to be portable (see some SRFIs) but we usually don't worry about minor inconsistencies within the larger Scheme community.
- qwertyuiop924 10y agoForget the GCs, let's talk about Cheney on the MTA! Now that's a difference in implementation. It's also why Chicken is A) freaking AWESOME!!! and B), totally sucks. But that's a story for another day...
- qwertyuiop924 10y agoBy nonportable, I assume you mean "between implementations", because that's where the nonportability is. And yes, there is. It has to do with scheme's origin. scheme originated in PL research (at the MIT AI lab) and was quickly pressed into service for education. As such, it has a strong userbase in academia. Those users need a language that was small, easy to implement, and powerful enough to express a wide variety of paradigms and concepts compactly. Meanwhile, Scheme users in the Real World, who want to Get Stuff Done, want that, but they also want things like OS interfaces, networking, module systems, FFIs, large standard libraries, etc. For many years, the approach the scheme standard took was to lay out the bare minimum required to be a scheme, and depend upon maintainers of various implementations to flesh it out. Furthermore, if the comitee couldn't agree on something, it went unspecified. This resulted in something akin to the unix situation, but worse: we had a family of languages named Scheme, but all but the simplest programs would inevitably depend on implementation-specific language extensions, and all the implementations extended the language in different directions. Furthermore, the academics need Scheme to be easy to implement, so it was: it was so simple any easy that anyone could implement it, and anyone did, resulting in a bevy of Scheme implementations of varying levels of quality, from "industrial strength" to "weekend hack". There are admirable efforts to write cross implementation packages (most famously, SLIB), but it's generally not recomended, because it's a PITA to do. R6RS tried to fix this, but... well, imagine that POSIX said, "we're trying to improve cross-system compatability, so you all have to implement Solaris Event Ports, Netlink, Streams, and the AIX sysadmin utilities to be considered POSIX. Just throw away whatever you were using instead of that." Needless to say, this did not go over well. R7RS tried to improve things by spliting the language into the traditional small core, and the larger stdlib, which you didn't have to implement to be scheme, but would hopefully improve interoperability between implementations. This seems to be working okay thus far, although the stdlib isn't done yet. We shall see...
- hajile 10y ago> Probably the closest thing to a vanilla scheme is Chibi Scheme, the reference implementation of R7RS. It's small, lightweight, and designed for static linking and embedding, like Lua. It has its extensions, of course, but they're fairly minimal. Don't forget larceny.
- qwertyuiop924 10y agoLarceny isn't particularly vanilla, AFAIK.