Lisp done right, according to some. Others prefer CommonLisp
, right at the other end of the oversimplified/baroque - or, if you prefer, elegant/full-featured - axis. Standard Scheme as defined by the RevisedReportOnAlgorithmicLanguageScheme
is deliberately minimalistic. SchemeRequestsForImplementation
provide de facto standards for often needed (and often requested) features and extensions, like record types, multi-threading, exception handling and localization.
Given its small size and minimalistic nature, some ask IsSchemeSuitableForDevelopingLargerSystems
Scheme was originally inspired by CarlHewitt
. It served as a proof by example that Actors' message-passing model of execution was equivalent to the more common function-call model. GeraldSussman
, the original creators of Scheme, discovered that when implementing both models, they ended up with identical functions doing the work.
In the words of GuySteele
): The Scheme programming language was born from an attempt in 1975 to explicate ObjectOrientedProgramming in terms that GeraldSussman and I could understand. In particular, we wanted to restate CarlHewitt's theory of actors in words of one syllable, so to speak. One of the conclusions that we reached was that "object" need not be a primitive notion in a programming language; one can build objects and their behavior from little more than assignable value cells and good old LambdaExpressions. Moreover, most of the objects in Hewitt's theory were stateless and unchanging once created; for those, lambda expressions alone were sufficient.
One outcome of this insight is that standard-compliant SchemeImplementations
are required to support ProperTailCall
Scheme is seen by some as the Algol of the LispFamily
- It has a considerably less dynamic feel than for example CommonLisp
- It introduced LexicalScoping into the LispFamily of ProgrammingLanguages, a feature subsequently adopted by CommonLisp
- It's a small language in the same way that Algol 60 was a small language.
- It lacks the ability to print an s-expression and parse it back in.
- The compiler operates on text, not s-expressions/forms
- The single namespace for variables and functions
Scheme is used in the books StructureAndInterpretationOfComputerPrograms
On getting the code for a procedure:
R5RS does not define an external representation for procedure objects and closures, so there is no portable answer. However, depending on the implementation techniques used and the sophistication of its run time system or debugger environment a given Scheme implementation may let you inspect the machine code or ByteCode representation and the bindings/environment for a given procedure object.
Also, it is possible without too much effort to redefine 'define' to store the definitions in a global map, thus making any non-primitive function's source available. With a little 'magic', it's actually quite easy to make an inspector with formatting, versioning, browsing, etc... :)
Moved from LearningScheme
An excellent way to learn Scheme (and a lot more besides!) is to read StructureAndInterpretationOfComputerPrograms
. Reading SICP is not however something you can do in a weekend, so to get a taste you may like to read a WebSchemeTutorial
. To play around, you'll need an interpreter like DrScheme
If you read a "LISP" tutorial, be mindful that there are many dialects of LISP of which Scheme is one, and while they are similar you will not be able to run (for example) CommonLisp
code in a Scheme interpreter. Generally things that relate to Scheme will say so directly, but if you're in doubt then a good rule of thumb is that names like null?
are Schemey, whereas zerop
, and setq
are more CommonLisp
Scheme bears roughly the same relationship to MacLisp and CommonLisp as JavaLanguage does to CeeLanguage and CeePlusPlus - or to be a bit more accurate, the same relationship PascalLanguage has to AlgolSixtyEight? and AdaLanguage, in that Scheme improved on MacLisp by simplifying and regularizing it, and was designed in the early 1970s by a small group of developers for a specific purpose (testing the relationship between Actors and closures, initially, and later, as a language for teaching), whereas Common Lisp improved on MacLisp by vastly expanding it and modernizing it, and was designed in the late 1970s and early 1980s by a large committee to support large project development across diverse platforms. - JayOsako
Evaluator in Silicon