Author Topic: Would you be interested in a Arduino UNO like board with Java8 programming?  (Read 6678 times)

0 Members and 1 Guest are viewing this topic.

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Hi All,

   I am trying to build a new development board which you can program in Java with Lambda support.
It has Arduino simplicity like apis to program and use hw peripherals. It make fw upgrade a magic as code can be put to any location.
Swapping codes/apps by dropping or maintaining its state is just an api call. Would you be interested in such a development platform?
What do you think is the best form factor and price point? Any feedback is appreciated!

Code: [Select]
package demo;
import eapi.*;

public class App {

    public static void main(String args[]) {

        final Led led = Led.init('C', 13); // Port C Pin 13
        PushButton pushButton = PushButton.init('A',
                                                8, //Port A Pin 8
                                                GPIO.INPUT_PULL_UP,
                                                GPIO.FALLING_EDGE,
                                                200, //debounce
                                                (time) -> {
            Core.println("push button event");
            led.flip();
        });

        while (true) {
            Looper.loop();
        }
}


Best Regards,
 

Offline jackthomson43

  • Contributor
  • Posts: 38
  • Country: us
It looks like a nice idea coz I haven't seen any board running Java8, but thing is what would be its purpose. As we have different boards these days like Raspberry Pi which supports everything. So how are you going to compete with Pi, Beaglebone etc. https://www.theengineeringprojects.com/2020/12/esp32-pinout-datasheet-features-applications.html
« Last Edit: March 07, 2021, 12:45:08 am by jackthomson43 »
 

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
It looks like a nice idea coz I haven't seen any board running Java8, but thing is what would be its purpose. As we have different boards these days like Raspberry Pi which supports everything. So how are you going to compete with Pi, Beaglebone etc.

Although It can run on MPU based board like Raspberry pi, this project is more focused on MCU based systems. It can run on STM32 and  esp32 based platforms.

It lowers the entry point to embedded systems as lot of people still learn java as first programming language. Syntax is easy to read and understand, not much boiler plate code with lamdas. Platform is providing and will provide more Arduino simplicity like apis. Less bugs with the help of language’s supports like out of bound array access and other type of exceptions. Having a vm gives you freedom to relocate the code where ever you like it makes fw upgrade easy. It opens door to plugin/app like features which can be downloadable. You do not need to manage the memory like you did in C, for example in this project there is no heap fragmentation.unlike with other vms, code is obfustucated at bytecode level.With oop and dynamic features you can use different programming paradigms. I am even working on a prototype where you can code on your phone or tablet than download the app over ble to your device.
 

Offline karamba

  • Contributor
  • Posts: 43
  • Country: us
Maybe it is just me but here is the order of the general purpose languages preferences I would prefer to see in an an embedded project.
1. C
2. C++
.
.
M. C# and .NET Core
.

.
Y. Python
X. Java

After introduction of .net core I think Java lost it's main advantage (or better to say C# lost its main disadvantage as it is supported on all main platforms not just Windows) Java is falling behind. At the company where I work Java is used only in legacy products, all new development happens in C#.
 
The following users thanked this post: justavm, Gregor Samsa

Offline radioactive

  • Regular Contributor
  • *
  • Posts: 173
  • Country: us
I can say I remember buying a dev board from Dallas Semiconductor (TINI)  back in the day (more than 20 years ago as I remember it) that had a fancy several-10's-of-mhz  8051 variant MCU that could run java code well enough to do a little http sever via Ethernet and turn leds on/off.  The code was pretty standard java code at the time.  Waaaay more standard than something like Android.

https://en.wikipedia.org/wiki/Tiny_Internet_Interface
http://en.wikibedia.ru/wiki/MxTNI

So,  Yeah,  definitely seems like you could get something to work for general headless kind of stuff.  Not so sure how well javax.swing.* is going to work though  (guessing not too good?).
 
The following users thanked this post: justavm

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
The three questions that come before price and availability are:
  • what are the unique benefits
  • what do you have to give up, in order to gain the benefits
  • can the same benefits be obtained other ways

I suspect the last one will be the most difficult.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: justavm, Gregor Samsa

Offline Fred27

  • Supporter
  • ****
  • Posts: 726
  • Country: gb
    • Fred's blog
No. I can think of nothing less appealing. Just because you can use a language on embedded systems, it doesn't mean that you should.
 
The following users thanked this post: GeorgeOfTheJungle, Howardlong, Yansi, justavm, Gregor Samsa

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6146
  • Country: ro
No.

Would be easier to make a poll question.

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
I can say I remember buying a dev board from Dallas Semiconductor (TINI)  back in the day (more than 20 years ago as I remember it) that had a fancy several-10's-of-mhz  8051 variant MCU that could run java code well enough to do a little http sever via Ethernet and turn leds on/off.  The code was pretty standard java code at the time.  Waaaay more standard than something like Android.

https://en.wikipedia.org/wiki/Tiny_Internet_Interface
http://en.wikibedia.ru/wiki/MxTNI

So,  Yeah,  definitely seems like you could get something to work for general headless kind of stuff.  Not so sure how well javax.swing.* is going to work though  (guessing not too good?).

I do remember too, i was pairing 8 bit pic with ne2000 ic with a minimal tcp/ip stack at the time. Because TINI was too slow, it was requiring as much as 4 secs to tackle 8kb array according to people who wanted to ship products. Price wise it was 3-4 times more expensive also. It was a head of its time.I just checked that price of the socket for tini module cost as much as blue pill  or an wifi enabled esp board.

Today lots of young developer think IOT is a new thing although it is at least two decades old. But today is a better time if not perfect as lots of tech aligned with consumer behaviour.

  By excluding punch cards we/developers were developing code by writing down hex than assembly. From otp/windowed to flash. C compiler was not feasible or not accessible. Then C/C++ compiler became normal. C compiler usage did not ramped up until gcc available for free with dev boards and debuggers go cheap. Today we are seeing even highly expensive software stacks becoming free. Embedded flash and sram size along with cpu speed increasing really fast also the power consumptions going down with better silicon processes thus prices. Also compiler tech is enhancing a lot and things become feasible with powerful PCs we have. I do believe that in very near future swift/kotlin a like language will become the new C/C++.

For Java i think issue is people are tired of it because of bad memories or hard to brake bad old experiences. Like people moved from Windows to Mac and forgot what a formatting regulary to speed up things mean. You can argue with the same price i can let somebody format my laptop every quarter :-DD. Some times developers did not liked things become easier, less fun? This almost never happened with C or C++ until security issues and difficulty of writing secure code pushed people to look better alternatives like Rust?

We seen developers jumping to objective c with fancy mac books to develop for iphone, like all those just invented. Also seen people developing for Android with Java, like it was never done before. I do believe they both manage to stick with being seamless or money  :-DD.

Google is going windows approach throw everything until one really stick or they drop like go, flutter, java, kotlin, python , js and etc.

Anyhow because of the future that i believe today I got simple example Kotlin app working with the same VM. It has more runtime dependencies thus may not able to support all fancy features of it in the beginning. Also got swift working on bare metal but runtime dependency is no go for low to medium end mcus but have some plans.

Those are intermediate steps for next. I do believe embedded systems deserves a new better language which scales well. I do not think it Rust or Micro python, i can talk the reasons with examples hours and hours.

What do you guys think?





 



 

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Maybe it is just me but here is the order of the general purpose languages preferences I would prefer to see in an an embedded project.
1. C
2. C++
.
.
M. C# and .NET Core
.

.
Y. Python
X. Java

After introduction of .net core I think Java lost it's main advantage (or better to say C# lost its main disadvantage as it is supported on all main platforms not just Windows) Java is falling behind. At the company where I work Java is used only in legacy products, all new development happens in C#.
Do you work in bay area? Which sector you guys are developing for? Would love to hear more real life stories. In the mean time I will update my knowledge base as its been a long time not checking .Net. Would love to hear more of your experience and your reasons.
« Last Edit: May 06, 2020, 05:32:54 am by justavm »
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Oh dear.
The further a society drifts from truth, the more it will hate those who speak it.
 
The following users thanked this post: Yansi, justavm

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
« Last Edit: May 06, 2020, 05:26:48 am by justavm »
 

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
I think if you really believe in the idea you should just go ahead, publish something, and let the "market" decide. I'm somewhat biased due to software engineering experiences but I'm willing to consider new evidence.  :popcorn:

My reaction to Java is "three". It takes three times as long to understand something, three times as long to write something, three times as long to build something, and three times as long to run something. Though JIT may have reduced the last. I think this is due to overemphasis on one style of programming such that everything must fit that paradigm. Hence factories and all sorts of circumlocutions.

So, show us the board and the development software environment for it.
 
The following users thanked this post: justavm

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Oh dear.
Be brave  ;) say more...

Java is too heavy both in cpu cycles and memory size requirements for a µC. For example, imagine the µC in an ABS: let's quit controlling for a while, it's time for a "stop the world" garbage collection...

No massive migration to micro python has happened, for the same reason. It has its uses though, but needs not any µC, but the most beefy ones.

Brave enough? ;)
The further a society drifts from truth, the more it will hate those who speak it.
 
The following users thanked this post: justavm

Offline 2N3055

  • Super Contributor
  • ***
  • Posts: 6453
  • Country: hr
Stop polluting the planet. Just say no to Java.
 
The following users thanked this post: Yansi, chriva, nuclearcat, Mp3, justavm

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7309
  • Country: nl
  • Current job: ATEX product design
Java is for programming dancing penguins on 160x120 resolution color Symbian phones.
Its one of those languages that will take a lot of effort to eradicate from the world. Like Flash.
 
The following users thanked this post: Yansi, chriva, justavm, Gregor Samsa

Offline Mp3

  • Frequent Contributor
  • **
  • Posts: 361
  • Country: us
Oh dear.
Be brave  ;) say more...

I appreciate your enthusiasm for providing new ways to learn programming very much. However, I'm not sure why you're set on Java, and the negative reactions to the choice of language is not for nothing. I learned Java in school and despised it since the market was already moving towards

Java absolutely should be left to die. It was a mess in the 90's, it was a mess in the 2000's, and it's even worse of a mess in the last decade. The world has moved on from Java as a whole, and the only people still using it are tied to legacy code for one reason or another.

The only people I know of who are employed as programmers who primarily or only work with Java for the last decade are senior managers of products that have been on the market for 20+ years. They are going to retire before their code is replaced with whatever is newer and more scalable.

Java does not scale well at all. That is why anyone who isn't using Java won't, though one could argue that such a project to help teach Java might come in handy several decades down the line where there's another instance of "COBOL programmers needed"  :palm:
High school graduate
 
The following users thanked this post: justavm

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Oh dear.
Be brave  ;) say more...

I appreciate your enthusiasm for providing new ways to learn programming very much. However, I'm not sure why you're set on Java, and the negative reactions to the choice of language is not for nothing. I learned Java in school and despised it since the market was already moving towards

Java absolutely should be left to die. It was a mess in the 90's, it was a mess in the 2000's, and it's even worse of a mess in the last decade. The world has moved on from Java as a whole, and the only people still using it are tied to legacy code for one reason or another.

The only people I know of who are employed as programmers who primarily or only work with Java for the last decade are senior managers of products that have been on the market for 20+ years. They are going to retire before their code is replaced with whatever is newer and more scalable.

Java does not scale well at all. That is why anyone who isn't using Java won't, though one could argue that such a project to help teach Java might come in handy several decades down the line where there's another instance of "COBOL programmers needed"  :palm:

Every point in that is false, pure and simple! If some caveats were added, there might just be some validity, but even then the points could be argued.

That does not imply the board proposed by the OP makes sense.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: justavm

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1183
  • Country: pl
Which Java? Very relevant for two reasons.

“Java” is a registered trademark of Oracle(USPTO#1)(USPTO#2)(USPTO#3)(USPTO#4)(USPTO#5)(USPTO#6)(USPTO#7)(USPTO#8)(USPTO#9)(USPTO#10)(USPTO#11), and there is history of litigation caused by not following the policies(Wikipedia) and simply using the API(Wikipedia). By claiming that you implementing Java, in particular if you do not actually do it, you are exposing yourself to some risk. By using that name without actually implementing it properly, you may also face hostility from Java developers themselves: many people helping others are simply tired of the deluge of Android beginnners. Bringing even more poeple like that will not make the situation any better.

Through the past 20 years Java has proven itself to be good platform for embedded environments — in particular with extremely limited resources and high variability between hardware. The problem is… which profile of Java are you going to implement? While the Card profile is fitting well into that environment, it doesn’t mean it will be right for arbitrarily chosen microcontroller and has enough of peculiarities to not be great for beginnners. SE and EE, on the other hand, are highly dynamic and have requirements that make them unsuitable for small devices. Even if you would decide to use Card, what will be the benefits compared to the curent Arduino platform? You lose some features. You are starting from zero, having to go through years of testing and fixing bugs that are already patched in Arduino. You run it on a microcontroller tha is inherently incompatible with the Java profile. What’s the point?
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: justavm

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
I think if you really believe in the idea you should just go ahead, publish something, and let the "market" decide. I'm somewhat biased due to software engineering experiences but I'm willing to consider new evidence.  :popcorn:

My reaction to Java is "three". It takes three times as long to understand something, three times as long to write something, three times as long to build something, and three times as long to run something. Though JIT may have reduced the last. I think this is due to overemphasis on one style of programming such that everything must fit that paradigm. Hence factories and all sorts of circumlocutions.

So, show us the board and the development software environment for it.

I am fixing the speed problem, it will run as fast as c++. By using different software paradigms we can code with less boiler plate code.
I need to understand more from you what part takes 3 times to understand is it the oop, language syntax, gc, or libraries.

I will release the project but i want to make sure it is not pre mature.
 

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Oh dear.
Be brave  ;) say more...

Java is too heavy both in cpu cycles and memory size requirements for a µC. For example, imagine the µC in an ABS: let's quit controlling for a while, it's time for a "stop the world" garbage collection...

No massive migration to micro python has happened, for the same reason. It has its uses though, but needs not any µC, but the most beefy ones.

Brave enough? ;)

This is way better  :-+ I understand you points now.

I am fixing the speed issue, it will run as fast as c++. GC can be done in background  and does not need to be a stop the world GC, it can be incremental. With swift you do not even need that. Code size will as almost similar as c++ usage too. Also i am providing a way to use C/Assembly call.

microypthon is targeting stem, i would love to hear if anybody shipped a product with it.
 

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Stop polluting the planet. Just say no to Java.

We are on the same page for polluting the planet. Tons of Android phones was running and some of them still runs dalvik vm without jit or aot. They were at least consuming 16 times more on cpu cycles and etc. My new Android phone consumes 1GB of ram just out of the box.

I hope you are not using any Android devices as all of them uses java. Kotlin on Android is just more class files for java compiler.

Polluting planet also happens in a way we write similar/same basic things again and again. Spending tons of time and money debugging same things again and again.

Tons of microcontrollers are running nops for delays. Majority of them despite they use Hw timers still does while loop checks. Really few embedded software scales power down when you run sleep x msecs.

Saying just no does not help, saying more what to look for will help a lot, thanks in advance.


 

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Which Java? Very relevant for two reasons.

“Java” is a registered trademark of Oracle(USPTO#1)(USPTO#2)(USPTO#3)(USPTO#4)(USPTO#5)(USPTO#6)(USPTO#7)(USPTO#8)(USPTO#9)(USPTO#10)(USPTO#11), and there is history of litigation caused by not following the policies(Wikipedia) and simply using the API(Wikipedia). By claiming that you implementing Java, in particular if you do not actually do it, you are exposing yourself to some risk. By using that name without actually implementing it properly, you may also face hostility from Java developers themselves: many people helping others are simply tired of the deluge of Android beginnners. Bringing even more poeple like that will not make the situation any better.

Through the past 20 years Java has proven itself to be good platform for embedded environments — in particular with extremely limited resources and high variability between hardware. The problem is… which profile of Java are you going to implement? While the Card profile is fitting well into that environment, it doesn’t mean it will be right for arbitrarily chosen microcontroller and has enough of peculiarities to not be great for beginnners. SE and EE, on the other hand, are highly dynamic and have requirements that make them unsuitable for small devices. Even if you would decide to use Card, what will be the benefits compared to the curent Arduino platform? You lose some features. You are starting from zero, having to go through years of testing and fixing bugs that are already patched in Arduino. You run it on a microcontroller tha is inherently incompatible with the Java profile. What’s the point?

Great question  :-+

Answer is none as similar to Android. I do believe language it self should be separated from support libraries and the runtime. Today people say Oracles wants monopoly which is way different than what Sun engineers thought about Java initially.

So it is Java a like language syntax as an intermediate state, ultimate goal is to introduce a new language targeting embedded systems. Kotlin and Swift are good candidates. With all the great open source tools we have it is even possible to create our own language from scratch which is designed by us not dictated, stay tuned.



 

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Oh dear.
Be brave  ;) say more...

I appreciate your enthusiasm for providing new ways to learn programming very much. However, I'm not sure why you're set on Java, and the negative reactions to the choice of language is not for nothing. I learned Java in school and despised it since the market was already moving towards

Java absolutely should be left to die. It was a mess in the 90's, it was a mess in the 2000's, and it's even worse of a mess in the last decade. The world has moved on from Java as a whole, and the only people still using it are tied to legacy code for one reason or another.

The only people I know of who are employed as programmers who primarily or only work with Java for the last decade are senior managers of products that have been on the market for 20+ years. They are going to retire before their code is replaced with whatever is newer and more scalable.

Java does not scale well at all. That is why anyone who isn't using Java won't, though one could argue that such a project to help teach Java might come in handy several decades down the line where there's another instance of "COBOL programmers needed"  :palm:

What is you opinion for the future of embedded systems development which language you will prefer and why?

What are the short coming of the languages you use today?
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Oh dear.
Be brave  ;) say more...

I appreciate your enthusiasm for providing new ways to learn programming very much. However, I'm not sure why you're set on Java, and the negative reactions to the choice of language is not for nothing. I learned Java in school and despised it since the market was already moving towards

Java absolutely should be left to die. It was a mess in the 90's, it was a mess in the 2000's, and it's even worse of a mess in the last decade. The world has moved on from Java as a whole, and the only people still using it are tied to legacy code for one reason or another.

The only people I know of who are employed as programmers who primarily or only work with Java for the last decade are senior managers of products that have been on the market for 20+ years. They are going to retire before their code is replaced with whatever is newer and more scalable.

Java does not scale well at all. That is why anyone who isn't using Java won't, though one could argue that such a project to help teach Java might come in handy several decades down the line where there's another instance of "COBOL programmers needed"  :palm:

What is you opinion for the future of embedded systems development which language you will prefer and why?

What are the short coming of the languages you use today?

Look at xC running on the XMOS xCORE processors. Hard realtime guarantees, multi core processing built in. Buy them at Digikey, 4000MIPS for £25, one off.

Beyond that, VHDL. The high frequency training mob use that for business rules. Seriously!
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: justavm

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
 
The following users thanked this post: justavm

Offline radioactive

  • Regular Contributor
  • *
  • Posts: 173
  • Country: us
It's already done

https://www.espruino.com/

javascript != java  (not even close).
 
The following users thanked this post: Yansi, justavm

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
[I am fixing the speed problem, it will run as fast as c++. By using different software paradigms we can code with less boiler plate code.
I need to understand more from you what part takes 3 times to understand is it the oop, language syntax, gc, or libraries.

As I said trying to cram everything into the OO paradigm distorts design, the syntax is unnecessarily prolix DRY wasn't heard of when the language was invented but later some simplifications retrofitted, GC has no effect on comprehension, and the libraries are the worst because there is so much you have to read before you can start to use them.

If you're going to start arguing those points, then perhaps you have already made up your mind, and you should just release the software and let it live or die on its own merits, or lack of.

So, good luck and :popcorn:
 
The following users thanked this post: justavm

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
 
The following users thanked this post: justavm

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
[I am fixing the speed problem, it will run as fast as c++. By using different software paradigms we can code with less boiler plate code.
I need to understand more from you what part takes 3 times to understand is it the oop, language syntax, gc, or libraries.

As I said trying to cram everything into the OO paradigm distorts design, the syntax is unnecessarily prolix DRY wasn't heard of when the language was invented but later some simplifications retrofitted, GC has no effect on comprehension, and the libraries are the worst because there is so much you have to read before you can start to use them.

If you're going to start arguing those points, then perhaps you have already made up your mind, and you should just release the software and let it live or die on its own merits, or lack of.

So, good luck and :popcorn:

What do you think about kotlin or swift?
 

Offline justavmTopic starter

  • Contributor
  • Posts: 16
  • Country: us
Well Java is also Done

http://www.rawbw.com/~davidm/tini/index.html

http://www.systronix.com/tini/tini_simm.htm

I wish you read the whole thread. Actually TinyVM is way before the tini. But it is not the point, we need to innovate. Other wise we will be saying “Which ordinary people wants a personal computer?”

Would love to hear your comment more around using java a like language for embedded systems.

 

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
What do you think about kotlin or swift?

I don't develop for those platforms these days. But certainly less verbiage than Java.
 
The following users thanked this post: justavm

Offline Fredderic

  • Regular Contributor
  • *
  • Posts: 67
  • Country: au
What I don't get, is this thing to release a new board for your own pet language.

Is your processor somehow specifically engineered to run Java?  Or will it just be another stock every-day processor with a pre-loaded bootloader/firmware glob that goes in before your java code?

My guess, is it's more that you can't make the money off the software, but if you shove the software in a chip, you can skim a nice profit off the "service" of adding value.  And worse, if you make it a new board, it can be different enough that people have to come to your design to run that software, and mayhaps can't decide to scub your software off of it and put Micropython on instead.

What I'd like to see, is an extensible tool that takes source code in one end, and produces an image ready to burn out the other.  Specifying a processor as the target, means I probably then have to specify also a lot of other things.  Specifying a board as the target, locks down several of those blanks, and provides defaults for several more.  One of those options, would be the choice of "operating system", so an Arduino normally comes with its bootloader, but that could have already been replaced by this Java runtime, maybe it's just known to be corrupted on this particular board, or I might just want of the various alternatives, or, the tool might recognise that the language coming in requires a different runtime to the one already present, and so offer to include it (or one of said alternatives) alongside the application image.  And then there's the delivery mode; could be a straight up hex image or two (the bootloader, for example) ready to burn, could be a combined image of both the bootloader and the application for "bare metal" installs to fresh chips, and then you only do application images for update installs.  Or at the extreme end, the option to smush it all together because you know you're Micropython code doesn't use the eval() function, and isn't ever going to need to do anything else, so you can do away with all that interpreter nonsense and just generate the microcode, and then feed it to the interpreter source as a constant, and let the compiler boil it all away to a static function — now THAT would be magic indeed (and probably isn't all that far off with modern compilers).  And when that's all done, your bootloader/runtime might offer OTA support, and so so a delivery package that takes the output and wraps it up in the correct format too (same layer as the one that converts the binary image into a nice hex file for the burner).

Now THAT is a thing I would like to see.  Kind of a mega-gcc.  Not this, "oh, I have a new pet language, I'm going to make a brand new board just for it" nonsense.  If that Micropython board has some extra bit of hardware that I like, but I don't know Python, why can't I target my Java code at it, it's just a different firmware.  (It'd actually be the other way around for me, but, nevermind that.)  When Arduino came out, it was pretty much the only game in town for it's target market.  Now they're a dime a dozen, and it's time to move on up the chain a little.

<ranty conclusion>
Do I think Java support for microcontrollers is a good idea?  Sure…  Why not.  I'm sure someone will appreciate it.  Do I think there should be a new Arduino UNO like board with Java8 programming?  No thanks.  If you've got something new to add to the board space, then put out a new board as well, and fine, preload it with your Java8 if you like.  But I do wish people would stop doing whole new boards that are only a slight tweak on existing ones, just for their own pet language.  If you have a significant idea for a new board, then do a new board.  If you have a significant idea for a new language, then do a new language.  If you happen to have both, then sure, offer them pre-combined as an option, and write "works with X" on the box.  Just don't make it a requirement.
</ranty conclusion>
 

Offline wizard69

  • Super Contributor
  • ***
  • Posts: 1175
  • Country: us
Hi All,

   I am trying to build a new development board which you can program in Java with Lambda support.
OK but why?
Quote
It has Arduino simplicity like apis to program and use hw peripherals. It make fw upgrade a magic as code can be put to any location.
Swapping codes/apps by dropping or maintaining its state is just an api call. Would you be interested in such a development platform?
What do you think is the best form factor and price point? Any feedback is appreciated!
You can't possibly put a worthwhile Java onto an Arduino class processor and have any redeeming value in the implementation.
Quote

Code: [Select]
package demo;
import eapi.*;

public class App {

    public static void main(String args[]) {

        final Led led = Led.init('C', 13); // Port C Pin 13
        PushButton pushButton = PushButton.init('A',
                                                8, //Port A Pin 8
                                                GPIO.INPUT_PULL_UP,
                                                GPIO.FALLING_EDGE,
                                                200, //debounce
                                                (time) -> {
            Core.println("push button event");
            led.flip();
        });

        while (true) {
            Looper.loop();
        }
}


Best Regards,

First off if I need rapid development on a microprocessor I can use MicroPython which is a much better environment for that type of work.    Python is well known and frankly it is easier for those one off projects.   If I need something more robust I can use C++ with far more control over the final executable.

On the other hand if I went JAVA I'd have the JVM to slow things down.   More likely if want to use a specific JAVA api it will not be supported mainly because there are far too many to choose from.   So I have the mess of a slow system and an endless number of apis that may or may not be supported.    What is sad is that JAVA had an embedded start but what it has evolved into is just a total disaster no matter what you use it for.   There are probably 10-20 other languages that would be a better choice for microprocessor programming.
 

Offline chriva

  • Regular Contributor
  • *
  • Posts: 102
  • Country: se
Just no (tm)

You either learn which language to use on MCUs or play with a garbage language like that on a device that has enough performance to handle it.

Same goes for micropython.
"We have more performance today so lets degrade it to what could be found 20 years ago"

Just stop this nonsense  |O |O |O
 
The following users thanked this post: Yansi

Offline wizard69

  • Super Contributor
  • ***
  • Posts: 1175
  • Country: us
Well number one no JVM.    If you can get either to compile to native code you might have something.    Swift is especially interesting as it merges new technology with code that can be written cleanly.   The biggest Swift issue is that it is not mature, literally many things are just coming online library wise.

If you went Swift or Kotlin you would have a huge marketing challenge to simply get the languages accepted in the embedded world.   Frankly I think the embedded world needs something better than C++.   Swift has a lot of potential here but there are not a lot of cross compilers at the moment.    So you would need a compiler developer as part of any board development solution.    I look at it this way we already know that JAVA in this space is a complete failure due to other attempts so if you went Swift or Kotlin you would not be trying to repeat those failures.

So the question becomes do you have the resources to build up the libraries for the use of these new languages.   You also need a cross compiler and a development environment.    You could go with a Swift REPL and have an interpreted environment which might work well.    However I suspect many developers would prefer a cross development environment where they can tune code size to a specific need.   Honestly I've thought about a Swift REPL embedded in a micro processor but I simply don't have the resources to work on something that big.   I can see a Swift REPL being better than a MicroPython solution.

[I am fixing the speed problem, it will run as fast as c++. By using different software paradigms we can code with less boiler plate code.
I need to understand more from you what part takes 3 times to understand is it the oop, language syntax, gc, or libraries.

As I said trying to cram everything into the OO paradigm distorts design, the syntax is unnecessarily prolix DRY wasn't heard of when the language was invented but later some simplifications retrofitted, GC has no effect on comprehension, and the libraries are the worst because there is so much you have to read before you can start to use them.

If you're going to start arguing those points, then perhaps you have already made up your mind, and you should just release the software and let it live or die on its own merits, or lack of.

So, good luck and :popcorn:

What do you think about kotlin or swift?
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
I'm wondering if the market is already saturated with *duino development platforms. Who is your target market for this platform?

A few years ago I experimented with Microsoft .Net Micro Framework - basically embedded C#. I used a Netduino, which as the name suggests, was an Arduino form factor, with a Cortex CPU. I did the 'hello blink led world' and PWM motor code, but I felt the feature rich .Net language was disconnected with the low level programming needs of a microcontroller. It's still around today under the open source .NET Gadgeteer platform, which tries to compete with the mbed programming system from Arm.

Thinking of mbed, and arduino playground, would your Java  be integrated with a cloud service? The mbed Nucleo IoT boards for example, can be developed/updated direct from the cloud.
 

Offline c64

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Hi All,

   I am trying to build a new development board which you can program in Java with Lambda support.
It has Arduino simplicity like apis to program and use hw peripherals. It make fw upgrade a magic as code can be put to any location.
Swapping codes/apps by dropping or maintaining its state is just an api call. Would you be interested in such a development platform?
What do you think is the best form factor and price point? Any feedback is appreciated!


How would you like to implement it? Write your own JVM? It will be like running emulator. It took Sun/Oracle many years to make it work at reasonable speed.

And also garbage collection and memory management ...

Maybe consider some alternatives like:
- Convert java source code into C / assembly
- Convert java byte code (compiled on your PC) into C / assembly
- Have FPGA and implement your own soft CPU which can run java natively. IMO this one is the best.

 

Offline c64

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
I don't think this idea is stupid (but most people here do  :))

Java has few advantages compared to C. Easy to learn as a first language. Safety checks. Run/debug your code on PC before uploading it to the board. If you need GUI, Swing probably will be too slow, but something native (AWT) should be ok. Huge amount of open source libraries, for anything you can think of. And the best development IDE, I'm not aware of anything for C/C++ even remotely close to IntelliJ Idea
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1617
  • Country: nz
Java was originally intended for embedded, and is widely used, so why not?

Of course the audience here probably already have a solution that suits them so most wont see the point.
 

Offline wizard69

  • Super Contributor
  • ***
  • Posts: 1175
  • Country: us
One issue for me is how much usable space will remain on the device after the JVM, Java, and the basics libraries.   

Usually with embedded you have two sometimes competing requirements, one is the best performance possible on the device which today means C or C++.   The opposite requirement is to get the job done as fast as possible with minimal stress, that is handled today with MicroPython or sometimes even Basic on older systems.   Sometimes these issues compete but for the most part tow different domains.    Java doesn't really fit either use case.

Maybe a few years down the road Swift embedded on a processor might make sense but right now you either compile a "C: language or run a processor with something like MicroPython on it.   I just don't see a future for java and frankly its past in embedded has been a failure.

I don't think this idea is stupid (but most people here do  :))

Java has few advantages compared to C. Easy to learn as a first language. Safety checks. Run/debug your code on PC before uploading it to the board. If you need GUI, Swing probably will be too slow, but something native (AWT) should be ok. Huge amount of open source libraries, for anything you can think of. And the best development IDE, I'm not aware of anything for C/C++ even remotely close to IntelliJ Idea
 

Offline NanoHawk

  • Contributor
  • Posts: 28
  • Country: us
I like your spirit of wanting to help people learn to program in embedded MCU's.

However, I think Java is a resource pig for an MCU.  Granted the processors have continued to get bigger and bigger.... but MCU's fundamentally mean working with minimal resources, minimal power, minimal memory for a specific purpose.  If you want general purpose get a Pi.  The higher level your language, the more overhead and resources are consumed to implement it.

I started with the Basic Stamp on my first project.  It was easy to access, but it was still programming and too complex to build a product out of.  So I rebuilt it in Arduino.  Then I rolled my own based on the ATTiny85.  I then decided to add an interface, so I used the Atmega328 so I'd have enough lines to run the 5 LED display units.  When I looked at doing ethernet I realized how resource intensive it was and then the ESP8266 series came along solving the problem.... actually reversing it because they emulate Arduino.

anyhow, my point is that if someone wants to program in MCU then he or she should be comfortable thinking through byte and line utilization.  It's sort of like Haiku for electronics.  Microsoft is like cow vomit for code.  There is a lot of it, it's very messy, and you aren't really sure what the cow ate. 
 
The following users thanked this post: GeorgeOfTheJungle


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf