Monkey ByteCode Target?

Monkey Archive Forums/Monkey Discussion/Monkey ByteCode Target?

AdamRedwoods(Posted 2013) [#1]
Anyone working on a Monkey bytecode target and VM? Native.
I know there's a Lua module out there.


ziggy(Posted 2013) [#2]
Why? You mean a brand new interpreter for Monkey, or something like Jasmin assembler, or the ILASM? I don't see why it should be useful taking into account we already have Java and C#? And I don't see any practical usage of translating Monkey source code to LUA, unless to do what you could already do in LUA.
Maybe you're after converting Monkey to an scripting language? That would be a very big task. I started something *like* this several months ago, but I leave it as it was too complex to be acomplished in a reasonable time, with my very little free time


AdamRedwoods(Posted 2013) [#3]
Why?

I would like to have a nice way to build scenes interactively with minib3d. i was thinking there might be something out there. perhaps i am thinking of a scripting language, rather than compiled bytecode? or perhaps i need JIT bytecode?


skid(Posted 2013) [#4]
I think a monkey b3d shell would be great, instead of being scriptable I would look at a remote connection so you can drive it from anything.


ziggy(Posted 2013) [#5]
AdamRedwookds, you can use CodeDom with XNA to do this. It allows you to compile C# (or vb) code at runtime in the form of a DLL and link it during runtime, and call any of their items using reflection, but this would mean XNA only. Maybe something else can be done like this? I don't know if the JVM includes a Java compiler too, as does the Microsoft .Net framework with C# and VB


skid(Posted 2013) [#6]
JS has the eval command and V8 is not overly complex to bolt onto C++ targets.

Hopefully Java will cease to exist soon, monkey should go native c++ on the Android front and discard it anyway in my opinion.


MikeHart(Posted 2013) [#7]
Hopefully Java will cease to exist soon

What makes you think it will? It is there for centuries and I don't think it will go at all.


Soap(Posted 2013) [#8]
Java needs to die like Flash needs to die. Right now it seems like it will take a long time for both to die, but really we don't know what will happen in the near future.

Oracle on Java: sue the good guys, add malware to the installers, introduce new security vulnerabilities with every patch.

It will cease to be popular if left in its present state. Devs will stop using it, users will stop having a reason to have it installed.

> It is there for centuries
Wat. Java is 18 years old? All that it would take to kill Java: stop installing it be default in the OS - already happening. Stop using it for web-stuff: already happening - most sites are transitioning to other tech. I bet that Minecraft will be ported away from Java sooner or later, and that's probably the killer app for Java right now keeping many people using it on their computers/browsers.


ziggy(Posted 2013) [#9]
I don't know if Java will ever die, but if it does, I just hope C++ dies sooner in favor of any of the better alternatives out there. C++ is an abomination that happens to allow the production of very optimized executables that are non portable. Thank god D exists. I see it as a potential substitute of Java and C++ and as a language that does have something better to offer.

In my opnion Java is a lot better than C++ as a language, but its implementation is very far from what I would considere stable, reliable and secure. I just hope it gets better, or replaced by something better (a well done Java implementation maybe not by Oracle, could be a good alternative to current Java).


therevills(Posted 2013) [#10]
Java isnt going anywhere... so many big businesses are using it.


AdamRedwoods(Posted 2013) [#11]
llvm/neko/v8/lua, they all require a bit of work.
my initial idea was monkey->js->v8, but i think monkey->lua or monkey->neko may be easier.

the absolute simplest way would be to use the browser (or stand-alone xulrunner?) using the minib3d javascript in webgl. this way new JS code can be compiled on the fly, with no cross-context gluing needed.
I'll probably try that first.


Soap(Posted 2013) [#12]
Many big businesses used Fortran too (and some still do)... Java-the-language does not have a massive future.


Samah(Posted 2013) [#13]
@AdamRedwood: Anyone working on a Monkey bytecode target and VM? Native.

I don't see the point. If you want to use a VM, just use one that's already cross-platform and learn the language. The only reason I can see that you would want to do this is to extern language features (like coroutines, metatables); but this defeats the whole purpose of Monkey.

@AdamRedwood: I know there's a Lua module out there.

MonkeyLua is for embedding Lua into Monkey, not converting Monkey to Lua.

@ziggy: ...Monkey source code to LUA, unless to do what you could already do in LUA.

Lua is a word, not an acronym. Otherwise we all code in MONKEY. :)


ziggy(Posted 2013) [#14]
LUA and Lua, I know I know but I always write it wrong...