Embedding Scheme for a game mission scripting DSL
carloscarrasco.com
carloscarrasco.com
It has been vigorously developed upon, lots of changes to make it more performant and you can catch the highlights of all this action on Andy Wingo's blog http://wingolog.org/tags/guile
I like his rundown of different Scheme implementations http://wingolog.org/archives/2013/01/07/an-opinionated-guide... including the comments that readers left there.
Another neat scheme for games that I am aware of is ypsilon http://code.google.com/p/ypsilon/ one driving motivation for it was to keep GC pauses small, pretty important for games. I believe it has an incremental GC, not a fully concurrent one.
> The requirements included "Windows (compiled with MSCV) and iOS." Guile can do that?
Yep! with MinGW on Windows. IIRC they distribute such a prepackaged bundle. Will probably work with cygwin dlls too. Dont know about GUI inter-op, but Guile would build with Xcode
@xpolitix Good point about the need to link statically on iOS, had not thought about that one.
I didn't know about ypsilon! The incremental/short pause GC looks very interesting indeed (although for the current usage in The Spatials I run TinyScheme as part of the map generation and then I completely unload it, so no GC, all the script logic gets encoded into command-like objets inside the C++ heap). But it appears it hasn't been developed for awhile. Still it's quite small, I will definitely look into in the future.
Windows (under Cygwin)
This is usually code for "needs UNIX/POSIX APIs", or its uglier cousin, "uses C99". I wouldn't mind Mingw32, and would mind a little bit Cygwin, but the problem is that for a video game I can't even begin to consider those platforms for Windows. All the official platform SDKs, or the third party ones (think Steam) require the Microsoft compilers and libs.
http://bellecrazysnail.wordpress.com/2013/11/14/some-thought...
There's also some weird double personality issues going on with their compilers in MSVC2013, for example they support designated initializers in plain C but not in C++. So you get partial C99 inside pure C or C89 (MS flavored) under C++.
I forgot where I read the quote, but for a decade Microsoft saw the plain C compiler as tool exclusively meant for Windows development. While gcc and later clang adopted and embraced new C idioms, like the struct syntax I mention, they kept their plain C support frozen in time.
I also found weird behavior in MSVC when pushing the C preprocessor VERY hard (nested variadic macros. That would require an entire blog post for itself...)
Some of the optional extension libraries like networking may not work out of the box, but TinyScheme doesn't have these anyway.
Basically, Chibi was designed as a better TinyScheme. It's just as small, can also easily be included statically without a library, has a nicer (optional) FFI, various features like full Unicode, full numeric tower and hygienic macros (all optional), and is an order of magnitude faster.
http://www.gnu.org/licenses/lgpl.html
In particular, iOS WebKit has been distributed in this fashion. You can download a source tarball from Apple that includes static binaries alongside the LGPL portions of the source.
The reasons for not wanting the LGPL probably have more to do with the LGPL placing obligations on Apple to convey source code to users upon request.
| ... Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work ...
This is practically impossible to do with under Apple Store forcing digital signing of applications (forbidding combined work), even if the developer provides modified source code.
I'm currently using mruby for a project and have been quite happy with it so far. The community around it is still somewhat thin, but the code quality is good and development is quite active. https://github.com/mruby/mruby
Out of interesting Lisp dialects, there's also PicoLisp (http://picolisp.com/wiki/?home) which looks like it should be well suited for embedding, but I didn't find any docs for how to do this with a quick search.
Well tinyscheme seems to be about half the size of Lua, which is not that different. Lua really is pretty small.
Android L is also going to kill jit compilers as well alas, see [1]
The info on mission scripting is really good though!
If you start exposing the engine in arbitrary fashion, things go south rather quickly; the scripting language will never stop finding more things it happens to need to get access to, and then you have an inner platform with boilerplate abstractions that make for worse tooling than whatever you started with.
Originally created by antirez, the "Jim" Tcl interpreter is pretty cool if you want something a bit more minimalistic than regular Tcl: http://jim.tcl.tk/index.html/doc/www/www/index.html