
Ask HN: Would you choose Dalvik VM to Arduino? - justavm
Hi All,<p><pre><code>    I developed a Dalvik VM in C from scratch which let you code in Java with lambdas.

 It runs as fast as Arduino UNO&#x2F;MEGA on a cheaper board with similar power consumption.
</code></pre>
Would you use an Arduino UNO like board which can be programmed in Java?<p>Below is the list of features<p>* &gt;1M instructions on STM32 based BluePill board(&lt;$3).<p>* Precise compacting GC. No fragmentation!<p>* Interrupt support.<p>* Native C interface generator.<p>* Platform abstraction layer for HW peripherals.<p>* Arrays, Float, Switch, Exception, Interface, Multiple inheritance, dynamic and etc.<p>Any information is appreciated!<p>Best Regards
======
alufers
Do native Java APIs, when paired with special hardware work on such a
solution? For example I think It would be cool to attach an Ethernet NIC to
such a board and just use Java's HTTP libraries.

Another aspect is, the size of the binaries, as many of those prototyping
devices are not limited by their processing speeds, but the flash size.

What about Kotlin support (I presume it works, since Kotlin is compatible with
java).

Cheers.

~~~
justavm
It is doable, but I do not believe existing java libraries not written well
enough to perform great and consume less space.

I do believe in separating code between the fast and slow path. My goal is to
bring open source, well optimized common libraries to VM world.

Platform can handle a simple http server with a NIC as of today but with
custom apis.

Kotlin and groovy works for hello world, did not tried further as I am
thinking of bringing those languages by eliminating Java ties. I am aware of
Kotlin native but 200K for a hello world is not reasonable. I can fit in 21K
for VM.

If you have killer app idea for this platform I can make it happen in a very
short period of time.

------
pietroglyph
Sounds like a cool project!

I prefer C++ to Java, but I think there’s absolutely a niche in the US
educational market because the AP Computer Science A test uses Java. It could
be pretty nice to have a Java-compatible MCU for the high school students I
mentor because that’s the language they know, and it would make some cool
hardware projects more accessible.

~~~
justavm
I will love to do a demo to you. I can provide a demo sdk if you want to give
it a try.

What are the top 3 reasons you prefer C++ to Java for embedded systems?

Do you have a killer project for students in your mind which will help them
learn with fun with this?

~~~
pietroglyph
This reply is a little late, but I work on things in the robotics space where
there are much more robust libraries for C++ than in Java, and some little
extra features (e.g. operator overloading for linear algebra libraries) really
make a big difference.

For students however I think that Java is probably the better call (fewer
footguns, more resources like the AP curriculum.)

