Arduino BASIC compiler

Those are all interpreters. What we are working on is a true compiler that generates native code (better code than GCC sometimes) !

Sorry, but the first two links are to commercial compilers, both of which claim to produce fast optimized code.

I have no dog in this hunt, but the questions you should ask yourself before continuing to put effort into what appears to be a commercial venture is what will your product offer that these don't. And more importantly will that be enough to capture a big enough market to make the development costs worthwhile, particularly given the existence of free options (Arduino/GCC) for those chips and their accessibility to even beginners (the traditional market for basic)?

Hi wanderson,
thank you for your answers.
BASCOM is the only commercial product being actively supported. FastAVR is no more developed since 2006 at my knowlege.
As for my compiler, it will be FREE for arduino, completely freeware.
Later we will enhance it to add support for all AVR chips and we will sell it as commercial product, but arduino version will remain Freeware !

phenry:
Those are all interpreters.
Actually the first two listed appear to be true Basic compilers, while the last three appear to be interpreters. Basic was originally designed as a interpreter only language, but many modern versions are true compilers.

What we are working on is a true compiler that generates native code (better code than GCC sometimes) !

What do you mean by 'better code than GCC sometimes? The Arduino IDE compiler is GCC, it's no better or worst then GCC, because it is GCC?
Lefty

@retrofly
Yes, ours is a true compiler.
Better than GCC I meant that our compiler generates better code than GCC does. Obtained program is more compact and make better use of registers than GCC compiler (used actually for Arduino).

phenry:
Hi wanderson,
thank you for your answers.
BASCOM is the only commercial product being actively supported. FastAVR is no more developed since 2006 at my knowlege.
As for my compiler, it will be FREE for arduino, completely freeware.
Later we will enhance it to add support for all AVR chips and we will sell it as commercial product, but arduino version will remain Freeware !

More power to you; however, since one such product ceased production, I doubt there will be enough of a market to pay for your development costs. much less make any kind of profit, particularly if you offer Arduino versions for free. In my opinion, the Arduino market is the one most likely (and not very, IMO) to be interested in such a product.

phenry:
@retrofly
Yes, ours is a true compiler.
Better than GCC I meant that our compiler generates better code than GCC does. Obtained program is more compact and make better use of registers than GCC compiler (used actually for Arduino).

Ah, I see, thought you were referring to the Arduino platform. Good luck with your offering.

I know that Basic is still popular for some, one only has to look at the Picaxe product line and forum to see that Basic+micro-controllers are still popular and very usable for some. The Basic Stamp product line is also still available, but it is rather long in the tooth these days. I used some Picaxe chips for a year or two and thought they were very easy to use and program. I changed to Arduino because I wanted to 'bite the bullet' and try and master C/C++, and while I'm certainly not a master I seem to be able to get done what I want.

Lefty

Honestly I think you'll be pushing sh1t up hill with a pointed stick getting existing embedded people to use BASIC.

Maybe those getting into the game (especially if they are coming from Picaxe et al) would be interested, but then you have the lack of existing Arduino-specific libraries and drivers to content with.


Rob

For me BASIC is just another 3rd generation programming language. The question will not be if the code is faster but if it is fast enough and 99% of the time C is. If not assembly becomes the first option - or redesign the algorithm, use a faster board, not another language.

I think it would become more interesting if you came up with a "sensor actuator motor language" that could easily be used by younger children, e.g. for programming robots. Call it ROBO-BASIC. That would give it a focusgroup and a possible market in the form of schools.

Nevertheless building a compiler is a nice piece of work (even if it won't beat the GCC)

Finally a language like Python would also be interesting in some markets. Or a rule-language which consists (mainly) of condition=>action clauses

Yes. I would be interested anyway. For some reason I have never really wrapped my mind around C as well as I have Basic. Heck, I can code in assembler better than I can in C!

Well the FreeBasic folk have had an option on their todo list to marry the FreeBasic front end to GCC since 2008, but I would imagine by now, it likely will never happen (FreeBASIC - Wikipedia).

Of course you could always just roll up your sleeves and do a new implementation of a Basic front end for GCC. It is certainly do-able, but it is a lot of work. If you've never worked on the GCC project before, I would expect it to take at least a couple of months for an experienced compiler developer to be able to interface with the current GCC environment, obviously much longer if you are neither a GCC developer nor a compiler developer. It's been about 30 years since I wrote a compiler front end, so I don't remember how long it takes to develop a simple first attempt at a front end.

Bear in mind, anything that uses GCC needs to be covered under the Gnu Public License (GPL), and that if ultimately you want the code to be a part of the GCC releases, you will need to donate the code to the Free Software Foundation.

Hi Phenry,

where I can download your compiler?

bye

phenry:
@retrofly
Yes, ours is a true compiler.
Better than GCC I meant that our compiler generates better code than GCC does. Obtained program is more compact and make better use of registers than GCC compiler (used actually for Arduino).

Any recent news about project?!

Hi I am new here and I dont know if I am right here to ask a question about Local Debug on Sloeber Arduino.
I have installed the 4.1 Version of plugin Sloeber.

Now I have tried to implement debug function to Sloeber.
I made as it is described in video tutorial. (Debug your arduino code on your local machine - YouTube)

But now after all i tried to compile in localdebug and it shows me the error:

20:09:00 **** Incremental Build of configuration localdebug for project blink ****
"D:\Arbeit\sloeber\arduinoPlugin\tools\make\make" all
'Building file: ...ino.cpp'
'Starting C++ compile'
"/bin/g++" -c -g -O0 -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR_LOCAL -DLOCAL_RUN -I"D:\Arbeit\git\hardware\jantje\avr_local\cores\arduino" -I"D:\Arbeit\git\hardware\jantje\avr_local\variants\avr:1.6.20:eightanaloginputs" -MMD -MP -MF".ino.cpp.d" -MT".ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "...ino.cpp" -o ".ino.cpp.o" -Dsrandom=srand -Drandom=rand
Das System kann den angegebenen Pfad nicht finden.
subdir.mk:24: recipe for target '.ino.cpp.o' failed
make: *** [.ino.cpp.o] Error 1
20:09:01 Build Finished (took 450ms)

As i understand it tried to call "/bin/g++" which is not possible cause also the command console doesnt find the path of g++.exe.

If it would be called simple with "g++" it will be found due to the windows path implementation shown in the video. I checked this in a cmd console!
What is wrong?
Can you help me?

best regards Klaus

Rather than starting a new topic, I want to see if there is some interest in BASIC for Arduino.

I am thinking of porting an ARM BASIC compiler to the Zero. This compiler supports, integers, strings, floating point, interrupts, multitasking and more.

This would be a free download. The port exists for other ARM devices so it should not take too long. And if interest warrants a version for AVR could be built.

A Nano is not a variant of an ARM processor.

And have you considered how much SRAM there is on a Nano?

...R

basicchip:
Rather than starting a new topic, I want to see if there is some interest in BASIC for Arduino.

I don't understand why anyone would want to cripple an already resource-poor architecture.

Meant to say Arduino Zero, or really a SAMD21 for a target for BASIC. Yes I know BASIC is looked down upon by the professional community, but it is a very capable language. And it is easy for non-professional programmers to read and modify.

Most people don't realize code is read by humans many more times than it is written.

I'm not really invested in this, but there are some things that are so much simpler to achieve in BASIC than in C, no matter how good the libraries are. The main one being string/text handling.

It took time to wrap my head around Arduino C/C++ (and it is much easier than C/C++ for operating systems), but I seriously miss those easy string functions.

I would love to see BASIC for Arduino etc. Whether I'd actually use it, on the other hand, is another question.

FWIW, I'm using the Arduino IDE for developing on AT Tiny85 up to the STM32F103 chips, so I need code that compiles down to very little at all (Tiny85) and a way to cram lots of twiddly bits into something more spacious (STM32). I'm not sure how well optimised any BASIC compiler would be with so many system options on te IDE.

AlyssonR:
but there are some things that are so much simpler to achieve in BASIC than in C, no matter how good the libraries are. The main one being string/text handling.

Indeed.

But, whatever program language you use, an Arduino does not have enough memory for that type of string handling. It works well when you have 2GB of ram. But not when you have 2K of ram.

...R