Go Down

Topic: Designing a new programming language for Arduino (Read 12169 times) previous topic - next topic

Robin2

Unfortunately every new board will require it and there is little reason to stay in the dark ages.

....SNIP....

On the contrary to robins argument if you force people to use a separate IDE,
I think we are at cross purposes.

I was only trying to say that @YemSalat's program should work with various IDEs - not that it should be tied to any particular one, either new or old.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

pYro_65

#121
Dec 20, 2015, 02:55 pm Last Edit: Dec 20, 2015, 03:06 pm by pYro_65
I think we are at cross purposes.

I was only trying to say that @YemSalat's program should work with various IDEs - not that it should be tied to any particular one, either new or old.

...R
Yeah I know what you're putting forward, however the old IDE isn't compatible, plain and simple. Whereas the new one is. It is not practical to copy source into the old IDE every time you need to compile... might as well use C++ which it supports directly. And requiring a new (non-arduino) IDE is not going to be as beneficial especially if it is an Arduino tool!

1.6.x has added the capability to fully control how the source is used, and its great I can use the ESP8266, Zero, and next year we will probably have the PINE64 using it.

You can run two different versions of the IDE if you do not want to upgrade your code that does not work, but either way, YemSalat's compiler chain will not work with old versions of the IDE; so it might as well use the latest and greatest (regardless of whether the code is C++98 or C++11 compatible).

Forum Mod anyone?
https://arduino.land/Moduino/

Robin2

It is not practical to copy source into the old IDE every time you need to compile...

...SNIP...

but either way, YemSalat's compiler chain will not work with old versions of the IDE; so it might as well use the latest and greatest
I had not realized there was any need to copy source code ... so maybe I have not quite got my head around how the new system will work.

There may still be the problem that it won't be compatible with a future version of the IDE.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

YemSalat

#123
Dec 20, 2015, 09:11 pm Last Edit: Dec 20, 2015, 09:23 pm by YemSalat
We might be getting a bit confused here.

Here are all the options that I currently see for uploading the new language to Arduino:

1) Adding a custom mode to the board manager (this is the option that pYro_65 has suggested, it is only supported on newer versions of the IDE) - this is the simplest and one of the most effective. All I need to do is add one more additional step to the Arduino toolchain and after that users will be able to just select the language from the board manager - and type it directly in the Arduino IDE. (You should also be able to use any custom editor with the official IDE)

2) Using my own IDE. Since version 1.5.5 - Arduino has command line tools (I am not sure how well they are  supported though) - I can run an agent that can 'talk' to my IDE and then use Arduino CLI to compile and upload the sketch.

3) Using the binary compiler of the language and the CLI tools. One could just use any custom editor and set up something like a makefile for compiling and uploading sketches.

4) Using Arduino IDE just as an uploading tool. So basically copy-pasting, even though it is not an option for 'professional' use, I think for many people (especially beginners) - copy-pasting can be a simpler option then setting up board managers, etc. Once they are more comfortable with the tools - they can switch to using other options.

Overall I think it is better to move towards the newer versions, however I would still like to do testing in the older ones as well.

Quote
Also, be aware that the Arduino development folks don't seem to bother at all with backwards compatibility.
Do you mean the IDE versions, or the libraries?

Robin2

4) Using Arduino IDE just as an uploading tool.
I use the Geany editor to create my code and just use the IDE to compile and upload. I did figure out how I could call the IDE from Geany but I don't actually do it that way - mainly because it was too much trouble to incorporate all the options that the IDE offers.

I guess, without really thinking hard, I had assumed your system would work in much the same way - i.e produce code that the IDE would consume.

There is no way I could use the IDE as an editor ... UGH

Also, I suspect it would be less confusing for a newcomer to use our editor for your language and use the Arduino editor for C/C++. But I can see that this is very much an area of personal preference.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

YemSalat

#125
Dec 22, 2015, 11:41 am Last Edit: Dec 22, 2015, 12:46 pm by YemSalat
I use the Geany editor to create my code and just use the IDE to compile and upload. I did figure out how I could call the IDE from Geany but I don't actually do it that way - mainly because it was too much trouble to incorporate all the options that the IDE offers.
I coded all my Arduino projects the same way so far, only used the IDE as compilation/uploading tool. (I use Sublime as my editor most of the time)

Quote
I guess, without really thinking hard, I had assumed your system would work in much the same way - i.e produce code that the IDE would consume.
That was the original idea, however pYro_65 brings up a good point that apart from this method - I could also add my own compilation recipe to the board manager, so people who do want to write code directly in the Arduino IDE - will be able to do so.


Quick update:
I updated the testing environment a bit: http://webcloudtools.com/sprk/lang-test/#hello-world
Nothing major, mostly refactored the default function parameters and updated the examples.
Added 'fancier' errors for number type overflows:



I am now working on arrays implementation.
I need to decide which is a better notation for arrays.

- having the array limit next to array type:
int[10] foo = [0..9]

- or having the limit next to the identifier:
int foo[10] = [0..9]

The second way is the same as it is in C++, which is a strong point towards it.
However first way seems to work better with implicit types, so one could write:
int[10] foo = [0..9]
or
foo = [0..9] - to let the compiler count the array length for you.

It also seems to be the way it is done in most other strong-typed languages (C#, Java, Go, etc.)

UKHeliBob

Quote
I need to decide which is a better notation for arrays.
That decision, as well as many others, should be influenced by what the purpose of the new programming language is. 

If it is to be stand alone and fully capable of doing anything that say C++ can do, just in a more logical and friendly way, then by all means implement the best and easiest syntax possible.  If, however, it is to be an introductory language that allows a subset of C++ functionality to be used with the aim of the user moving on to C++ when they reach a point that they need its functionality then surely it makes sense for the syntax to match C++ as far as possible whilst providing meaningful error messages and possibly context sensitive help, command completion, automatic insertion of brackets, braces, etc where they are used.

I for one am confused as to the purpose of the new language.

Go back and read your original post in this thread.  Have you strayed outside of your original objectives and maybe let feature creep start to occur ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Robin2

I suggested STOP in Reply #108.

I respectfully suggest that the ONLY work you should do NOW is on things that are ESSENTIAL before publishing the product so that people can try it out.

Don't worry about anything that "could be improved" or even about any shortcomings that don't actually prevent it working.

When you have published the first version and got some user feedback you can then think about what changes might justify producing a second version.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

YemSalat

#128
Dec 23, 2015, 04:19 pm Last Edit: Dec 23, 2015, 04:20 pm by YemSalat
I for one am confused as to the purpose of the new language.

Go back and read your original post in this thread.  Have you strayed outside of your original objectives and maybe let feature creep start to occur ?
I agree that I have deviated from some of the ideas that I layed out in the first post (I should probably update it)
Most approaches that are currently in the language have been chosen for reasons of better compatibility with exisitng Arduino environment.

I am hoping to avoid the 'feature creep' (with some help from the community at times :) )

I think its best to do what @Robin is suggesting now - I will finish the first version of the project (IDE + current version of the language w/o any more modifications) - then get some user feedback and decide what is the best direction to take the project next.

PS
I probably won't be posting for the next couple days, hope everybody has great holidays!

UKHeliBob

Quote
I agree that I have deviated from some of the ideas that I layed out in the first post (I should probably update it)
If you do decide to update it please do so by adding to it explaining why the objectives have changed rather than changing the stated objectives.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Robin2

@YemSalat, one lesson that I have learned has been somewhat painful - and it happens every time. Whenever I display something to users they are ALWAYS interested in some aspect that I have not been bothered with. Most recently the handheld plastic box I put the demo model in was too big - they took the functionality for granted!

Getting user feedback is vital.

It is wise to be aware of the bicycle shed syndrome.


...R

Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up