What is wrong with the BASIC language?

General discussion for topics related to the FreeBASIC project or its community.
pidd
Posts: 31
Joined: Nov 11, 2022 16:27

Re: What is wrong with the BASIC language?

Post by pidd »

caseih wrote: Dec 01, 2022 17:06 Just curious. What are you doing in C that you couldn't do in FB? Leaving aside the mountains of macros that are involved in C header files making them a challenge to translate to FB, C code itself is 1:1 translatable to FB.

What do you mean by over using for/next loops?
Programming Raspberry Pi Pico microcontrollers, I have a choice between C, micropython, arduino, BBC Basic (and at least one other basic) or assembly. C wins hands down, unfortunately I have to use cmake with that but only for the SDK interfaces, not for my code. BBC Basic actually interprets on the Pico rather than cross-compiling from another machine - which would be a contradiction for an interpreter lol.

It would be interesting to make a FBC Pico SDK library but the cmake dependency would add a degree of complexity.

I instinctively use for-next, usually because I can't be bothered checking which loop syntax each language does - I'm getting old, memory isn't good, learning new things is unrealistic. Because I've used a for-next I then either use flags, exit-for or variable-manipulation to escape the for-next when really I should have used either a pre-conditional or post-conditional loop in the first place.

Sorry about terminology, I make it up as I go along.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: What is wrong with the BASIC language?

Post by caseih »

Yes that makes sense. Different people have talked for years about targeting microcontrollers with FB, but no one has volunteered to try doing a port. Potentially the C emitter could be used but there's the issue of the large runtime library which is needed for a wide array of FB language features. Perhaps a subset of FB might be workable.
pidd
Posts: 31
Joined: Nov 11, 2022 16:27

Re: What is wrong with the BASIC language?

Post by pidd »

Porting it would be way beyond my capabilities but you have got me thinking. I'm not sure how far BBC Basic or MMBasic (memotech emulator) has integrated the SDK/hardware interfaces, if they have, whatever they have done must be like 90% of the way there to integrating with FB especially as they are interpreters. Perhaps they have just cherry-picked what is similar to their original computers.
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: What is wrong with the BASIC language?

Post by BasicCoder2 »

pid wrote:
I'm getting old, memory isn't good, learning new things is unrealistic.
I can learn new things however I do have a problem remembering what I used to know :)
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: What is wrong with the BASIC language?

Post by caseih »

Porting FB is beyond my capabilities as well! I'm pretty content with the languages that I do use in various places (embedded microcontrollers, Android, and Linux). I don't actually use FB for anything other than nostalgia reasons: running old code from my youth on Linux and Windows. I suspect the majority of forum members are very similar, save for a few who regularly do amazing things in FB.

Anyway I enjoy learning, but, I'm not sure I'll ever pick up Rust. And my Javascript is fairly rudimentary.
Post Reply