Scheme in C++(solarianprogrammer.com)
solarianprogrammer.com
Scheme in C++
http://solarianprogrammer.com/2011/11/21/implementing-scheme-in-cpp-2/
5 comments
Racket Scheme (http://racket-lang.org) is a good Scheme implementation and provides plugins for other languages. C, for example:
http://planet.racket-lang.org/package-source/jaymccarthy/c.p...
Plugin Database: http://planet.racket-lang.org
http://planet.racket-lang.org/package-source/jaymccarthy/c.p...
Plugin Database: http://planet.racket-lang.org
Racket is good, but I think the discussion here is more about educational implementations - small, simple to grasp. There are of course also a number of industrial-strength implementations of the Scheme language in C and C++, but those are hardly the best place to start this learning!
Guile is worth mentioning here. Mature, LGPL and widely used. It supports R5RS and most of R6. It has hygienic macros. If you're looking to use a Scheme in production, you probably want Guile.
Stalin and Chicken Scheme might also be worth a look if you aren't faint of hearth.
http://www.gnu.org/s/guile/
Stalin and Chicken Scheme might also be worth a look if you aren't faint of hearth.
http://www.gnu.org/s/guile/
Scheme has a really simple syntax but wouldn't this code be a little more readable with separate lexing, parsing, and evaluating steps?
The code is open source (GPL3), feel free to fork it from github and modify it.
This was the OOP course project in my UG. Spent an entire semester on it. http://www.cse.ust.hk/~dekai/151H/
Code is unreadable (I have to scroll horziontally). Better paste it as a gist.
The first version of the code was assembled in a few hours and badly structured.
The new code from github is more readable:
https://github.com/sol-prog/schm
The new code from github is more readable:
https://github.com/sol-prog/schm
It is available at github (https://github.com/sol-prog/schm) and readable.
The implementation linked here is IMHO badly written - that's not good code to learn from. So if your goal is to learn how to implement Scheme, I suggest to look elsewhere. For example, one good resource is Scheme from Scratch: http://michaux.ca/articles/scheme-from-scratch-introduction
Note that this is nothing personal, I just frankly think this is not good code to learn from.