#2358 Fantom for Anduino and embedded systems?

ac413 Sun 12 Oct 2014

Hi, A new programming language always needs a following to make it more commonly used, so having Arduino compatibility would certainly help Fantom. I recently discovered uJ and "nanoVM" virtual machines for embedded systems including certain Arduino boards. They only take between 50-200k to run! I am wondering if there are any plans to use Fantom with a VM on Arduino. Since many Arduino users are new to programming, fantom/java seems like a much better base to get started with than C. Java and C# also have better learning tools for beginners than C, so they are a natural choice for teaching robotics.

Arduino is a great way to learn about electronics and computer programming. The one thing missing from it, is a bridge beyond the Arduino IDE and C language. After learning some basic blinking LEDs, buzzer chirps, and button presses, students hit a brick wall in terms of good coding practices. Things like functions and arrays are almost never explained in an Arduino tutorial. Since there are so many example projects out there, copy and paste becomes the Arduino standard way to code! Since it is already possible to run Java on an Arduino Mega, maybe Fantom could work. There is a 10% loss in speed using a VM, so classic 16MHz Arduino boards may be a bit slow, but with new technology, 48MHz is becoming the new standard. The most exciting part of Fantom on Arduino, is that $10 hardware just became good enough to run a JVM, and Fantom - not Java - could be the best way to use it! In 3 years time, most embedded boards will have ARM processors, and run at 84MHz or more, so now is the time for Fantom to take advantage of robotics and the internet of things.

Thanks For Reading, -Andrew

SlimerDude Mon 13 Oct 2014

Wow, uJ really does look, um, micro!

To get Fantom running on other JVMs, including Avian (topic), it would be really useful to have a list of Java classes and packages that the core Fantom libs use.

Does anyone know if it's possible to generate this somehow?

brian Mon 20 Oct 2014

I haven't looked at uJ, but the issue with most super micro VMs is that they don't support dynamic class loading. So you couldn't use the Fantom runtime per se. However if they run straight Java bytecode (or precompile Java bytecode) then you can precompile all the Fantom code to bytecode using something JarDist and then try that.

What is really good about Fantom is that it minimizes the Java libraries required - its actually a very small subset. We run Fantom on embedded devices too, just not that small :)

SlimerDude Sun 26 Oct 2014

the Java libraries required - its actually a very small subset.

Cool, is it possible to generate a list of Java classes that Fantom requires?

Login or Signup to reply.