Boost logo

Boost :

From: Guillaume Chereau (charlie137_at_[hidden])
Date: 2006-07-12 10:52:14


Hello,
I want to suggest a new boost library, that could be used to parse and
run lisp programs.
I think of a way to create at compile time a language interpreter with
list syntax, but with only the needed features. It could be used for
people who need to run simple scripts from a C++ program, but who
don't want to use python.

Here is an naive example to illustrate what I mean (I hope it is clear
enough by itself)

using boost.lisp
// we create the lisp interpreter with integer and math operation support
lisp::lisp<lisp::with_int, lisp::with_math> mylisp;
// we run the lisp program : (+ 10 20)
lisp::result res = mylisp.run(lisp::word("+") >> 10 >> 20);
std::cout << ret.as<int>() << std::endl;
// same thing but from a string
res = mylisp.run(lisp::parse("(+ 10 20)") )

It may then be possible to expose C++ functions and classes the same
way it has been done for python by the boost.python library.

What do you think of this idea ?
Guillaume


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk