本文介绍了小和C ++中的可读方案解释器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道C ++中好的/小型方案解释器吗?最好是<2000 LOC,带有一个简单的垃圾收集器(压缩或标记和清除),不需要支持所有R5RS,只需支持if/lambda/set!/cons/car/cdr的基础知识和一些基本操作即可.

Anyone know of a good / small scheme interpreter in C++? Perferably something < 2000 LOC, with a simple garbage collectro (either compacting or mark & sweep), no need to support all of R5RS, just basics of if/lambda/set!/cons/car/cdr and some basic operations.

谢谢!

推荐答案

好吧,这里有一个 vecery little lisp ,作者是Gary Knott.甚至还不及R5RS,但它很小,并且附带一本描述内部原理的书!但是,它是C,而不是C ++,据我所知没有GC(但我可能错了).

Well, there's a veeery tiny lisp by Gary Knott. Not even close to R5RS, but it's small, and comes with a book describing the internals! However, it's C, not C++, and as far as I can remember there's no GC (but I could be wrong).

还有Nils Holm的 Mini Scheme ,但这是也是C,比您的要求要大一些(C的2404行加上Scheme的1352行).Nils还编写了空白空间"中的方案9 ,该方案虽然较大,但还随附了一本书,描述了每段代码

There's also Mini Scheme by Nils Holm, but it's also C, and a bit larger than what you asked (2404 lines of C plus 1352 of Scheme). Nils has also written Scheme 9 from Empty Space, which is larger but also comes with a book describing every piece of code.

Tinyscheme 是另一个小型方案(C的4500行加上Lisp的452)...

Tinyscheme is another small Scheme (4500 lines of C plus 452 of Lisp)...

这篇关于小和C ++中的可读方案解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 06:31