[question] it's possible to migrate jack language to moblie phones?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[question] it's possible to migrate jack language to moblie phones?

jack chan
I have a few old runnable android mobile phones.
can I use these devices to build and run jack language for real touching and feeling?
is there anybody thought that before?
Reply | Threaded
Open this post in threaded view
|

Re: [question] it's possible to migrate jack language to moblie phones?

WBahn
Administrator
It would have to be an extension of the Hack hardware and possibly of the VM and Jack. The Hack has no way to communicate with things outside of itself. At the very least you would have to implement I/O devices and memory map them into the RAM space somewhere (just above the Keyboard probably makes the most sense).
Reply | Threaded
Open this post in threaded view
|

Re: [question] it's possible to migrate jack language to moblie phones?

jack chan
Yeah, I know that mobile phone hardware is not very matched to the Hack hardware. I'm not familiar with mobile phone hardware details. This link answers show that run simplest x86 Assembly code on real hardware. Compare to the Hack hardware, it seems that real machines are more detailed and complex. If I want to go more, it's a possible way to build the VM from real hardware Assembly to support Jack language?
Reply | Threaded
Open this post in threaded view
|

Re: [question] it's possible to migrate jack language to moblie phones?

WBahn
Administrator
There's two very different approaches and at this point I don't know which you are talking about.

If you are talking about being able to run Jack programs on using your mobile phone's assembly language, then all you need to do is write a VM that has the same VM commands but that generates output using your phone's assembly language. That's part of the beauty of the VM. If you want to run Java programs on the Hack hardware, all you need to do is write a compiler that compiles Java source code to the VM command language.

What's nice about that approach is that you immediately have access to everything that can be done in assembly on the phone's hardware. You are also then running code natively on the phone's hardware, so it will be much faster. You would probably benefit from extending the VM language and/or the Jack language to support more capabilities, but you probably wouldn't have to if you didn't want to.

The downside is that you have to learn how to program in your phone's assembly language and have the tools needed to do so.

The other approach is write an emulator that will run Hack assembly language programs on your phone's hardware (essentially write your version of the hardware simulator that the authors provided). The good news here is that it can be written in whatever high-level language you want. You will need to decide how you will access the phone's hardware features that you want and incorporate that into your Hack hardware design, which may or may not affect the VM command set and/or compiler. The downside to this is that execution speed of your programs will be very slow (just as it is when running your programs on the hardware simulator).

Yet another option is to write your own VM emulator that runs on your phone. This will let you regain much of the lost performance, but writing a VM emulator is a LOT more complicated than writing a hardware emulator.
Reply | Threaded
Open this post in threaded view
|

Re: [question] it's possible to migrate jack language to moblie phones?

jack chan
Thank you for your explanation, have a nice day!