Sign in to follow this  

simple statically typed scripting language?

This topic is 2659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi guys,

I'm looking for a *simple* statically typed scripting language (ideally interpred via some kind of bytecode). I'm also considering writing my own but it's not an easy task and I definitely don't want to reinvent the wheel. Could be useful for world though if such a thing does not exist :-).

I'm planning to use it for my J2ME game which I'm developing for ages now (well, I'll switch to androind once J2ME dies completely:o)). Core engine is slowly starting to work and I need scripting for obvious reasons. Also, scripts reduces code size (normal classes are not garbage collected).

Only real world, ready to use to use scripting language for J2ME seems to be Kahlua. However it's slow. I've written a proof of concept statically typed VM and an assembler and it performs about 10x faster than Lua (still 10x slower than "native" code, but that's acceptable). Don't take me wrong, Kahlua itself is a remarkable piece of code but cost of dynamic typing is just too high. Therefore I need static typing.

I've been searching for some time and so far I found (erm..) two languages, which, after some patching could do the job.

* talc <http://code.google.com/p/talc> - seems a quite buggy and not really maintained. I was playing around with it, trying to re-target it to my toy VM with mixed success
* haXe <http://haxe.org> (found this one searching gamedev forums:o)) - according to examples it seems too java-like. Very complex too.

To sum up features, I expect from the language:

* it has to be cute
* functions
* structs
* automatic type inference would be nice
* a big plus would be some simple bytecode format. Then I could just write VM for J2ME and I'm done :-).

Any advice counts.

Share this post


Link to post
Share on other sites
Couldn't find any statically typed scripting language for J2ME, but here's a few dynamic ones u might want to try

https://pnuts.dev.java.net/
http://code.google.com/p/mochalua/
http://code.google.com/p/jillcode/

If J2ME is not a current precondition, you can check out Angel Script

http://www.angelcode.com/angelscript/

They have a forum here.

Good Luck!

-ddn

Share this post


Link to post
Share on other sites
Lua's just too slow. For example I would like to code some top level AI as a script (like couple of lines, aggregating path-finding and some utility calls implemented in native world, but executed over and over). Pnuts (according to quick look at website) seems quite death and features dynamic compilation, which by definition cannot work on J2ME (and according to your post it's dynamic).

Angel Script, on the other hand could work. I can image writing a VM for precompiled bytecode for J2ME. I'll take a closer look at this approach to see if it may work. Really *hate* the name though :-).

Share this post


Link to post
Share on other sites

This topic is 2659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this