[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[glob2-devel] An other candidate language for map scripting
From: |
Martin Voelkle |
Subject: |
[glob2-devel] An other candidate language for map scripting |
Date: |
Wed, 26 Jul 2006 22:37:37 +0200 |
Hi folks!
Sorry to revive the subject that caused so much pain, but I just
discovered that the Scala language could allow us to script scenarii
quite easily.
For those who are new here, read this thread: [1]
In short, to script maps, we need a language that is
* checkpointable, allowing to save the complete state of execution
(heaps and stacks) of the script when the game is saved
* sandboxed, allowing to download scripted maps from the web without
security issues.
Python (the stackless version) lacks sandboxing, most other languages
lack checkpointing. Of course, LISP lacks none, but the learning curve
would be too big for map scripters.
The Scala language [2] has a programmer-friendly way of doing
event-based programming [3] that should allow us to do checkpointing.
Taking the same example as in [4], we can write in Scala:
doSomething();
wait(condition) {
doSomethingElse();
}
The program can be interrupted at the wait, saved with a saved game,
restored later (even on an other machine) and resumed.
Now the bad news: Scala requires a Java environment. Glob2 would need
to embed a virtual machine (GCJ does the job), which is available in
today's stock OS and distribs.
I haven't done a proof of concept to verify that everything work like
I have stated. There is no plan yet to use Scala as a scripting
language for maps. I am just informing and seeking comments.
Cheers,
Martin
[1] http://lists.nongnu.org/archive/html/glob2-devel/2005-12/msg00010.html
[2] http://scala.epfl.ch/
[3] http://lampwww.epfl.ch/~odersky/papers/jmlc06.pdf
[4] http://lists.nongnu.org/archive/html/glob2-devel/2005-12/msg00026.html
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [glob2-devel] An other candidate language for map scripting,
Martin Voelkle <=