The code isn't on GitHub yet, but it will be. This is intended to be an open source project. Once I decide on the final direction of the project (and the name) then I will upload it. Shouldn't be too long, a matter of days/weeks, not years.
You should name it GaryBasic or GSBasic or GSB. I would develop it further and make it into a fun project that could allow it to be a great tool to train future programmers on or try to make it really lean and fast compared to other basic interpreters.
I think you should publish what you have and then all those development paths you listed can be forks. Besides, the community can surely help developing, testing and documenting it. It will certainly be a learning opportunity for many.
In the old Atari basic there was an undocumented x** command (I forgotten the other two letters) but basically it had a bunch of parameters and could substitute for every other function/command including ones in the source that didn't have a name, you can find it in the source code .. Another feature (bug) I liked, a program could print a string that was a program line followed by char$(13) and that would enter the generated program line into memory, that enabled one to write self modifiing code!!!! I miss that .
Hi Gary, definitely pick this up and push it further. As an open source project, it has the potential to become very popular and open up programming microcontrollers to an even wider audience.
Good Gary, glad Basic is still a good learning language. I programmed (in the 80s) using Business Basic also known as Basis BBX. I worked on the MAI Basic Four Mini computer, Basic Four also had a small main frame that could have up to 250 terminals, with four 1200 LPM printers.
If you want to extend Basic further than what basic was in the 80's and create a powerful educational tool you could name your interpreter Basic++ meaning that your interpreter has much more than one would expect from good old basic.
I think microcontrollers are where I would place it's roots. Add some pin defines like Arduino and mimic the Arduino functionality. Pico, esp32, stm, atmel. . . Pick your favorite. Let it roll! I want your code. Post it.
I learned 3d graphics while in high school with Basic4GL. Sadly, it's outdated and not developed anymore. There was also DarkBasic for quick game development, but that one was commercial. Consider implementing/porting some kind of graphics library, maybe even add bindings for SDL2. Maybe call it LightBasic (as a nod to DarkBasic).
BASIC dialects often follow the capabilities of the platform they are running on. Half of the effort is often the interactive line editor. Around 1978-79, I wrote a BASIC interpreter for the Apple][ that was modeled after Digital Equipment Corporation's BASIC+Plus on pdp-11 RSTS-E. It used file channels instead of slot select (PR#x) so a program could do IO with the printer, a file, the keyboard, and the screen, all at once rather than having to select different slots depending on which device was the target for a particular operation. That was written in 6502 assembly.
We had a Commodore PET growing up and if memory serves, that Basic Interpreter was written by Microsoft. Later on there was Microsoft GW Basic which was significanly enhanced for MS-DOS. HP9845 microsomputer had HP basic with was so hyper modified it was more like Pascal.
Needs WHILE LOOP, ARRAY. Nice to have cursor (ncurse), mouse. Graphics (screen size, putpixel, readpixel, savescreen, load screen) If you want to use SDL, how about BASIC to C compiler?
One idea for this, is to be an educational tool for those trying to understand basic logic. So make the parser give out meaningful feedback when something goes wrong and maybe this will be picked up by primary schools who are introducing basic to young children. Example if I type Print "Hello the interpreter will not simply reply with a "syntax error in line 4" but "Syntax error in line 4. Print is usually followed by some text in quotation marks. Example Print "Hello". In this way younger generation can appreciate retro style code whilst benefiting from the availability of unlimited resources that we have today. Back in the day we were so pressed for memory that the interpreter could only afford to write Syntax Error.
Awesome, I've just started working on my own command line kernel OS. Having a BASIC shell is something I want it to have available on boot. I was thinking, if possible, to use it as a scripting language.
My understanding, is that one of the places basic is still used in modern production is VisualBasic in excel. I think that means that the largest base of (non-nastalgia based) users of basic are familiar with that syntax. So I'd try to add more features and syntax from VisualBasic so that people can migrate easier. There's also QB64 which is probably the more advanced version of Basic still usable on modern desktops. Might be some ideas to steal there? As far as names, how about GE Basic for Gary Explains, and kinda sounds like GW Basic, which was the one I started with in DOS decades ago. A really wild idea would be to implement classes and object oriented code in it. I don't know how that would even be possible but something to consider. Oh! Another idea. Basic used to be the language people started out on, but nowadays its Python. Would be interesting to make it a python library so that you could call basic subroutines through python. I dunno if that would be at all useful, but would be neat none the less. One final idea. Since you seem to be interested in Android. Hoe about making it an Android Basic interpreter? And then give it a Android keyboard kind of like the Z80 where each key is a full basic command, to make input easier. Would make it quick and easy to write fast scripts on your mobile when you want to do some complex calculations. Cool project!!!
Yes, but if there is a difference between Visual Basic and Basic. I'm from the older generation and I used Basic. I tried Visual Basic, but it didn't work out. I prefer Python. I also prefer MariaSQL or OpenSQL above something from MS. I'm not a MS basher. I use Office regularly besides Linux alternatives.
@@LenQuerido Oh for sure. To be clear, I'm not suggesting he "go full visual basic" only that some of the more modern commands and expressions be brought over as features, especially where other basics have also adapted them. For instance Visual Basic (if I remember correctly) can handle currency and dates similarly to how excel can, has string handlers like rtrim and ltrim. And has arrays (Although.. maybe they go back to Qbasic?)
@@MrDowntemp0 It's nice and maybe it's useful. It was many years ago I used it, but when you ever reached a certain level of experience you'll never forget the language. I guess it needs some time.
I think it's cool but not sure another basic interpreter is needed. United of course you can create a specialisation that other languages or basics don't have. Could you create a front end language for LLVM with basic language?
SturdyBasic Please make sure you include the CLS command When you make one for the Pi : Set all the pins to out so they do not have to be declared when staring programming Pin1 On Pin1 Off Pin 1 In - changes the pin to input. Rien from Amsterdam
GeeBASIC I almost always need interrupts I would like to be able to have something run 'in the background', and wake up by some interrupt source, like TIME, a special mouse or keyboard input, I/O--- I've used BASIC on a microcontroller, in 'the old days', an HC11 4 MHz, and the 8K BASIC from a Motorola guy was actually useful for industrial control, ran 20k for-next loops per second, had a number of interrupt sources. I guess, for me, it's most useful on a tablet, doing some kind of relatively simple user input, save it to a file, but running all the time in background, to allow input any time needed... or embedded control, fairly simple stuff, so it could be just doing logic operations on a bit field, with bit positions as variables, timers and time of day, 'Real Time" in a 'soft' sense, actions on a 100 ms kind of response...
I reckon a basic won’t be that useful on our desktop PC. But on a SBC that could be nice. The trick now is to write a runtime for those SBc. And an efficient one. So I could write a programme in basic running faster than python on my PI. That….. could be a nice way to go.
Now serious. I think you can sell it as a basic interpreter and a product to starters. If you can then somehow copy the way Cobol (or clipper) index files, you then can improve the interpreter... Later if you can get a compiler later it would then have a more robust product.
I believe that BASIC was written in 1963. I remember when I learnt Fortran on an ICL mainframe in the mid-70s that there was a BASIC too, no idea what version
Pi Pico W version?, as in patch in some WiFi library. There is another basic/micro computer based on the Pico W, but they got stuck when the 'Pico W' came out.
That's really cool. ❤ Reminds me I've got a stalled project writing an AtariBASIC tokenizer in C++ just for fun that I need to finish. And it would be cool to write an interpreter for both the raw AtariBASIC and the tokenized BASIC for bonus points, even though no one would ever use it and most of the POKE commands would be useless withiut the underlying Atari Computer emulation. Anyway, BASIC was once the language every kid learned to program with and every computer had some flavor of BASIC. Today I suppose JavaScript is the best analog, since it exists in every web browser and can do so many tricks, especially when you bring NodeJS into the equation. But BASIC might be due for a comeback. I've had occasion to build things in VisualBASIC, QBASIC, and REALbasic in modern times and they all served a practical need whilst also feeding into my nostalgia.
I first used BASIC in the late-70's. I went on to use Visual BASIC (among other languages) through the early 90's. I loved the language and wrote a lot of fun and useful programs with it. I think extending your interpreter for PICO with GPIO support and with many of the other capabilities you listed in your "Limitations" slide plus arrays (even TRS-80 Level I BASIC had exactly 2 one-dimensional arrays!) would be great and offer easier access to the platform by younger, less experienced users. The name you select should be general enough so that it could be ported to other platforms and still make sense.
My favorite basic was what Bill Gates put on the Radio Shack model 100 laptop. It was very complete and well polished. It had file I/O and with some hacks could do pixel graphics on a 320x120 LCD display. Adding gpio to an environment like that would be huge. Throw in library support and I think it would stick for a long time.
It looks like you're having great fun developing your BASIC dialect. You should have a look at a quite new BASIC for the C64 called Vision Basic. It's very fast since it's compiled to machine language when you RUN it. You can also have embedded machine language code in your BASIC code! It's not free but well worth a look.
Basic was not only fun, but I used it in the early days for technical computations. It worked great. It was a little outdated and I was a little ashamed, because at the university we had big IBM machines and one DEC for my faculty. Those were the days...
If you want to port it to a microcontroller like Pico you need to do something unique with it since BASIC is already available. I suggest something that can run in the background and be used to control customizable tasks based on the needs of the user. So not a boot to BASIC something more like TinyScript.
This is so cool. I would love to see this on microcontrollers. I miss the good old days learning basic on various computers. Don't get me wrong, I like Python and C but Basic is so easy to learn that I think it would have a place out there. Thanks for another great video.
Hi, Would be nice to see it go down the microController route, maybe similar to how micropython works, you take your .bas file and if its saved on the device it auto starts or if its pushed through the serial interface it in direct mode. if it was to take off you could make an small ide like thonny etc to upload and create the bas file,and include some sort of repl instead of serial monito for direct mode
goBasic would be a good name. Like BASIC ++ too. Just continue the development, you are on the right track. It should be able to handle interrupts and it would be cool to see a somewhat implementation on a Real Time task manager. That would really pump up the attention. Bite and bytes manipulation would be an excellent option. I wish a could be a coder because I would of like to help out. 👏👍
I love BASIC. I have always loved BASIC. May be because its my mother tongue. And because I grew up with BASIC. Name suggestion: GET BASIC Gary Explains Thru BASIC. Purpose: Education. Learn Compilers Learn GPIO Learn Pico Learn Graphics Learn OS The list goes on forever. You pick a topic that you're great at. Let others contribute on topics that resonates them. And, let the next generation benefit from our collective knowledge. I'd love to contribute.
Well why not call it gBasic as a nod to MS’s bundled favourite gw…? Like you I started with Sinclair Basic (Spectrum), but professionaly I’ve created/maintained software in various Microsoft variants well into this century: Power…, Visual…, embedded Visual….
You don't particularly need to name it "tiny" or "micro", etc. It could be "Gary's Wicked Basic" or GW Basic... oops, taken. Anyhoo, you could try a retroprogramming sort of thing. Make games and the like. Perhaps a standardized low rez screen output.
I suppose GazBas would be a bit self-indulgent. It's occurred to me that the definition of what BASIC is has gotten a bit fuzzy. We've had compiled BASIC, so that's not part of the definition. Removing line numbers and using labels is another (welcome) step away. When do all the extra functions stop being part of the language and become more like precompiled libraries etc. My feeling is, yes, nice little project but there are better alternatives out there now.
Ahhh, Sinclair BASIC that is what I started with, then Commodore, Quick Basic and Visual Basic although there is one additional one called "FREE" basic that I still have and play around with every now and then. If you look at your random number generator, some things never change, every other number generated is either an even number or an odd number. I remember modifying the Random number generator to stop things like this.Yes, my first "Laptop" was a Sinclair 1000 computer.
I like: itsy-bitsy BASIC What i would actually like to see is a multi-platform BASIC compiler. The same BASIC source code would compile into computer specific machine code. Start with strictly text; that'll run on a ZX81, PET, BBC, Vic20, C64, etc.
There are several good desktop/game BASICs like Freebasic or QB64 so what's the use of re-inventing the wheel (except for fun). But a good microcontroller BASIC would be very useful. Many would love to make IOT software with BASIC. Raspberry Pi BASIC with PLC style functions would be super!
I think you could have some very interesting content if you produced a primitive specializing adaptive interpreter. It's a new approach that Python is moving to for version 3.11. I don't think there's a lot of people out there who have tried that before. BASICally you change your interpreter to cache nformation about what it's interpreting alongside the program so you can speed it up. You could also write a compiler for BASIC in BASIC and then use it to compile itself while running on your interpreter. For simplicity of demonstration you can emit C code instead of native. Thus, you write a C code generator that takes BASIC as input. Then you provide it itself as the input and execute it in your current interpreter. Presto! A compiler written in its own language.
Writing line numbers seems far to tedious. Would be far be better to at least have "GOTO # display image". I also love that we didn't have to type PRINT because a question mark did the same. "Basically"... I'm far more into Python coding pixilation image generators that are most often not complex much as I am quite limited by the speed process.
Always wondered why there is no an easy language like basic to create desktop applications? Something easy and old people like myself are familiar with! Maybe as another step, to be able to link app’s written in Python, so Basic does the gui and event’s driven programming and python does the heavy lifting in the background
hi Gary ... thanks for the video .. francly i dont have a purpose for the code rightnow .... but the basics are the most important to me .... each line coud have the same story of Lazer .. and the name to me is Teatchy
Gary, I sent you an email that you may find interesting. It is about the unusual features provided in a language interpreter from the distant past. The language was called BMIL.
Interpreted BASIC is largely useless. Yes, it’s literally the first thing I learned. AppleSoft BASIC offers more than your example, although it does require line numbers, and fit in less than 12K of ROM. Replacing line numbers with labels, and a decent text/program editor is a notable improvement. That’s not a knock on BASIC. Compiled BASICs such as VB (DOS or Windows) are my preferred languages, because I can deliver about 95% of the performance of C(derivatives) and accomplish the task with 2x-5x less dev time. I’ve written real-time processing code in compiled BASIC, occasionally supplemented by some ASM or C routines for “bit twiddling”. Given that, my opinion is this: It’s a neat project, and you should release it OSS, but unless it has a more complete feature set, AND is a JIT (or similar) compiler, I’m not sure you’ve added anything.😊
After thinking about it, for a while, i came to the conclusion, that you should go the microsoft way. Bundle your nanobasic together with your new operationg system for the nano and sell it. I see a market for it. Very interesting. Like to hear your answer.
Porting it to a Raspberry Pi Pico is my first obvious choice of what you should do with it next! You should call it gBASIC for gary's BASIC... not sure how that would play out if you read it too fast...
I think how you meant to title this is that you forked an existing project and modified it. Back in the 90's when I first started with C I wrote a BASIC interpreter that had a built-in REPL, so line numbers were used to allow you to edit lines specifically, like the older interpreters did. The reason to start with 10 was so you could potentially insert 9 more lines in front of it, if needed. And thus the reason to use multiples of 10 should be self-evident, but I'll explain it anyway, you could insert new lines between the old lines you already wrote. I don't know who first decided to introduce "let" into imperative languages, but you should remove that. Either use context to determine assignment, like the original interpreters did, or go the Pascal route and use := for assignment.
I really like this idea… I would call it GEbasic... and while I like the idea of putting it to raspberry pi as an alternative to python which I hate… I think it would be really useful as a teaching language… Teaching folks how to write a interpreter individually a compiler… I think there are plenty of embedded languages blue among them… So I wouldn't go that direction… But in the spirit of Gary explains everything… I think it's a really good launching on point for everything having to do with the internals of interpreters and compilers including garbage collection native functions etc.… Nicely done… I continue to subscribe… Best wishes and continued success
I know by GEbasic you meant Gary Explains, but I wonder if General Electric ever had a version. I knew they were in the computer space and in the AOL, QuantumLink, CompuServe era they had a service called GEnie. A quick search did not turn up one, but it was surprising to learn that the very first version of BASIC, at Dartmouth, ran on the school's two General Electric computers!
@GaryExplains right. Give it an element of AI capability like in java-8 by implementing lambda functionality, and your 'Basic' will be in great demand, I suppose.
Open source your version, link to the original version, and if you're feeling particularly pedagogical, make some short videos explaining how and why you made each change. If that series proves popular (and/or you just enjoy doing it) then you can extend it by implementing the missing features.
This is so awesome Gary, I would love to contribute towards developments of this project. I see this being used to teach young people (high schoolers) about microcontrollers without really needing to learn a programming language. May I suggest PicoBASIC
@@GaryExplains if u can get it into an arduino, many more people would have a go. save programs and run from sd card, we are all trying to do that. pi is an overkill.maybe mega 2560 or due.how about a nano!?would be a next level for arduino.write and run, yes yes yes...
no i mean pico pi is overkill in features and you need a whole opperating system to blink an led, no good to teach kids with!.... but Basic on an arduino...yes yes yes.@@GaryExplains
You don't need a whole operating system to blink a LED. 1) You can just use MicoPython (the modern equivalent of BASIC). It is interpreted and the interpreter runs on the board without an underling OS. 2) You can use Arduino!!! There is good support for the Pico in the Arduino IDE.
The code isn't on GitHub yet, but it will be. This is intended to be an open source project. Once I decide on the final direction of the project (and the name) then I will upload it. Shouldn't be too long, a matter of days/weeks, not years.
You should name it GaryBasic or GSBasic or GSB. I would develop it further and make it into a fun project that could allow it to be a great tool to train future programmers on or try to make it really lean and fast compared to other basic interpreters.
I think you should publish what you have and then all those development paths you listed can be forks. Besides, the community can surely help developing, testing and documenting it. It will certainly be a learning opportunity for many.
BASIMS? Beginners' All-purpose Symbolic Instructions for Minute Stuff
In the old Atari basic there was an undocumented x** command (I forgotten the other two letters) but basically it had a bunch of parameters and could substitute for every other function/command including ones in the source that didn't have a name, you can find it in the source code ..
Another feature (bug) I liked, a program could print a string that was a program line followed by char$(13) and that would enter the generated program line into memory, that enabled one to write self modifiing code!!!!
I miss that .
maybe newBASIC? or probably better nuBasic
*GaryBASIC* lol
Love this. You're an even bigger geek than I thought. And I'm now an even bigger fan 🙂
🤓
😂
On a micro controller with Peek and Poke commands would be cool. Great way to easily explore the various peripherals.
It the micro has input and output instructions adding those would be good too. I am thinking of a Z80 or the like.
@@kensmith5694 Yes, that was my thinking. The limited features and direct interaction with the hardware is a great way to learn.
nice and powerfull instructions
peek and poke...yes yes yes... on an arduino!
Hi Gary, definitely pick this up and push it further. As an open source project, it has the potential to become very popular and open up programming microcontrollers to an even wider audience.
Good Gary, glad Basic is still a good learning language. I programmed (in the 80s) using Business Basic also known as Basis BBX. I worked on the MAI Basic Four Mini computer, Basic Four also had a small main frame that could have up to 250 terminals, with four 1200 LPM printers.
im still thinking in Basic, even while programming in C. i made a full cnc router running on quick basic, so easy to edit.
If you want to extend Basic further than what basic was in the 80's and create a powerful educational tool you could name your interpreter Basic++ meaning that your interpreter has much more than one would expect from good old basic.
I like GSB or GSBASIC as Raven Pluim suggested. As for what to do next - a virtual machine and byte code.
built your own basic hand-held computer around an mcu you understand well enough.
I think microcontrollers are where I would place it's roots. Add some pin defines like Arduino and mimic the Arduino functionality. Pico, esp32, stm, atmel. . . Pick your favorite. Let it roll! I want your code. Post it.
Could structure the code and documentation in a way that's educational for anybody interested in the inerworkings of an interpreter
I vote for the microcontroller direction
I learned 3d graphics while in high school with Basic4GL. Sadly, it's outdated and not developed anymore. There was also DarkBasic for quick game development, but that one was commercial.
Consider implementing/porting some kind of graphics library, maybe even add bindings for SDL2. Maybe call it LightBasic (as a nod to DarkBasic).
BASIC dialects often follow the capabilities of the platform they are running on. Half of the effort is often the interactive line editor.
Around 1978-79, I wrote a BASIC interpreter for the Apple][ that was modeled after Digital Equipment Corporation's BASIC+Plus on pdp-11 RSTS-E. It used file channels instead of slot select (PR#x) so a program could do IO with the printer, a file, the keyboard, and the screen, all at once rather than having to select different slots depending on which device was the target for a particular operation. That was written in 6502 assembly.
We had a Commodore PET growing up and if memory serves, that Basic Interpreter was written by Microsoft. Later on there was Microsoft GW Basic which was significanly enhanced for MS-DOS. HP9845 microsomputer had HP basic with was so hyper modified it was more like Pascal.
Needs WHILE LOOP, ARRAY.
Nice to have cursor (ncurse), mouse.
Graphics (screen size, putpixel, readpixel, savescreen, load screen)
If you want to use SDL, how about BASIC to C compiler?
geBasic - Gary Explains' Basic 😀
I think that you should do whatever sounds like the most fun! In the end this is for you. Who cares if others find it useful or not?
Turn it into a FORTH compiler.
🤦♂️
Agreed...this should be the top comment 😉
One idea for this, is to be an educational tool for those trying to understand basic logic. So make the parser give out meaningful feedback when something goes wrong and maybe this will be picked up by primary schools who are introducing basic to young children. Example if I type Print "Hello the interpreter will not simply reply with a "syntax error in line 4" but "Syntax error in line 4. Print is usually followed by some text in quotation marks. Example Print "Hello". In this way younger generation can appreciate retro style code whilst benefiting from the availability of unlimited resources that we have today. Back in the day we were so pressed for memory that the interpreter could only afford to write Syntax Error.
We had Ti BASIC, Ti Extended Basic, GW BASIC, MS BASIC and Basica, and we wuz lucky to have 'em. Ha very nice, Gary!
i´d hope for ports to many MCUs so Basic can be run + IO support on as many devices as possible!
Awesome, I've just started working on my own command line kernel OS. Having a BASIC shell is something I want it to have available on boot. I was thinking, if possible, to use it as a scripting language.
Sounds great!
My understanding, is that one of the places basic is still used in modern production is VisualBasic in excel. I think that means that the largest base of (non-nastalgia based) users of basic are familiar with that syntax. So I'd try to add more features and syntax from VisualBasic so that people can migrate easier. There's also QB64 which is probably the more advanced version of Basic still usable on modern desktops. Might be some ideas to steal there? As far as names, how about GE Basic for Gary Explains, and kinda sounds like GW Basic, which was the one I started with in DOS decades ago.
A really wild idea would be to implement classes and object oriented code in it. I don't know how that would even be possible but something to consider.
Oh! Another idea. Basic used to be the language people started out on, but nowadays its Python. Would be interesting to make it a python library so that you could call basic subroutines through python. I dunno if that would be at all useful, but would be neat none the less.
One final idea. Since you seem to be interested in Android. Hoe about making it an Android Basic interpreter? And then give it a Android keyboard kind of like the Z80 where each key is a full basic command, to make input easier. Would make it quick and easy to write fast scripts on your mobile when you want to do some complex calculations.
Cool project!!!
Yes, but if there is a difference between Visual Basic and Basic. I'm from the older generation and I used Basic. I tried Visual Basic, but it didn't work out. I prefer Python. I also prefer MariaSQL or OpenSQL above something from MS. I'm not a MS basher. I use Office regularly besides Linux alternatives.
@@LenQuerido Oh for sure. To be clear, I'm not suggesting he "go full visual basic" only that some of the more modern commands and expressions be brought over as features, especially where other basics have also adapted them. For instance Visual Basic (if I remember correctly) can handle currency and dates similarly to how excel can, has string handlers like rtrim and ltrim. And has arrays (Although.. maybe they go back to Qbasic?)
@@MrDowntemp0 It's nice and maybe it's useful. It was many years ago I used it, but when you ever reached a certain level of experience you'll never forget the language. I guess it needs some time.
I think it's cool but not sure another basic interpreter is needed. United of course you can create a specialisation that other languages or basics don't have. Could you create a front end language for LLVM with basic language?
SturdyBasic
Please make sure you include the CLS command
When you make one for the Pi :
Set all the pins to out so they do not have to be declared when staring programming
Pin1 On
Pin1 Off
Pin 1 In - changes the pin to input.
Rien from Amsterdam
GeeBASIC
I almost always need interrupts
I would like to be able to have something run 'in the background', and wake up by some interrupt source, like TIME, a special mouse or keyboard input, I/O---
I've used BASIC on a microcontroller, in 'the old days', an HC11 4 MHz, and the 8K BASIC from a Motorola guy was actually useful for industrial control, ran 20k for-next loops per second, had a number of interrupt sources.
I guess, for me, it's most useful on a tablet, doing some kind of relatively simple user input, save it to a file, but running all the time in background, to allow input any time needed... or embedded control, fairly simple stuff, so it could be just doing logic operations on a bit field, with bit positions as variables, timers and time of day, 'Real Time" in a 'soft' sense, actions on a 100 ms kind of response...
I reckon a basic won’t be that useful on our desktop PC. But on a SBC that could be nice.
The trick now is to write a runtime for those SBc. And an efficient one. So I could write a programme in basic running faster than python on my PI.
That….. could be a nice way to go.
Now serious. I think you can sell it as a basic interpreter and a product to starters. If you can then somehow copy the way Cobol (or clipper) index files, you then can improve the interpreter... Later if you can get a compiler later it would then have a more robust product.
I believe that BASIC was written in 1963. I remember when I learnt Fortran on an ICL mainframe in the mid-70s that there was a BASIC too, no idea what version
Pi Pico W version?, as in patch in some WiFi library.
There is another basic/micro computer based on the Pico W, but they got stuck when the 'Pico W' came out.
I used PICK Basic and developed a complete business suit for furniture stores on it
That's really cool. ❤ Reminds me I've got a stalled project writing an AtariBASIC tokenizer in C++ just for fun that I need to finish. And it would be cool to write an interpreter for both the raw AtariBASIC and the tokenized BASIC for bonus points, even though no one would ever use it and most of the POKE commands would be useless withiut the underlying Atari Computer emulation. Anyway, BASIC was once the language every kid learned to program with and every computer had some flavor of BASIC. Today I suppose JavaScript is the best analog, since it exists in every web browser and can do so many tricks, especially when you bring NodeJS into the equation. But BASIC might be due for a comeback. I've had occasion to build things in VisualBASIC, QBASIC, and REALbasic in modern times and they all served a practical need whilst also feeding into my nostalgia.
I first used BASIC in the late-70's. I went on to use Visual BASIC (among other languages) through the early 90's. I loved the language and wrote a lot of fun and useful programs with it. I think extending your interpreter for PICO with GPIO support and with many of the other capabilities you listed in your "Limitations" slide plus arrays (even TRS-80 Level I BASIC had exactly 2 one-dimensional arrays!) would be great and offer easier access to the platform by younger, less experienced users. The name you select should be general enough so that it could be ported to other platforms and still make sense.
My favorite basic was what Bill Gates put on the Radio Shack model 100 laptop. It was very complete and well polished. It had file I/O and with some hacks could do pixel graphics on a 320x120 LCD display. Adding gpio to an environment like that would be huge. Throw in library support and I think it would stick for a long time.
It looks like you're having great fun developing your BASIC dialect. You should have a look at a quite new BASIC for the C64 called Vision Basic. It's very fast since it's compiled to machine language when you RUN it. You can also have embedded machine language code in your BASIC code! It's not free but well worth a look.
Basic was not only fun, but I used it in the early days for technical computations. It worked great. It was a little outdated and I was a little ashamed, because at the university we had big IBM machines and one DEC for my faculty. Those were the days...
If you want to port it to a microcontroller like Pico you need to do something unique with it since BASIC is already available. I suggest something that can run in the background and be used to control customizable tasks based on the needs of the user. So not a boot to BASIC something more like TinyScript.
This is so cool. I would love to see this on microcontrollers. I miss the good old days learning basic on various computers. Don't get me wrong, I like Python and C but Basic is so easy to learn that I think it would have a place out there. Thanks for another great video.
Hi, Would be nice to see it go down the microController route, maybe similar to how micropython works, you take your .bas file and if its saved on the device it auto starts or if its pushed through the serial interface it in direct mode. if it was to take off you could make an small ide like thonny etc to upload and create the bas file,and include some sort of repl instead of serial monito for direct mode
Awesome. So much to learn from you. Baby steps.
Once you have it where you want it development wise, add a compiler to make it rip. Debugger?
I'd be very curious to explore the idea of a cross platform UI engine. That's a bit complicated given the different native UI APIs
I would like to see a general scripting language for the OS including a shell cmd to run other programs.
goBasic would be a good name. Like BASIC ++ too. Just continue the development, you are on the right track. It should be able to handle interrupts and it would be cool to see a somewhat implementation on a Real Time task manager. That would really pump up the attention. Bite and bytes manipulation would be an excellent option. I wish a could be a coder because I would of like to help out.
👏👍
Very interesting ! I will try it.
I learned programming on Applesoft Basic. Later I used QBasic and Quick Basic.
what about YABASIC: Yet Another BASIC? (going with the "standard" way of naming things in the FOSS world :P)
YABI - Yet Another BASIC Interpreter 👍😁
@@GaryExplains yup, sounds good!
This is a great video, thank you Gary. I think we have enough of desktop and game dev tools. The microcontroller idea is the best.
I love BASIC. I have always loved BASIC. May be because its my mother tongue. And because I grew up with BASIC.
Name suggestion: GET BASIC
Gary Explains Thru BASIC.
Purpose: Education.
Learn Compilers
Learn GPIO
Learn Pico
Learn Graphics
Learn OS
The list goes on forever.
You pick a topic that you're great at. Let others contribute on topics that resonates them.
And, let the next generation benefit from our collective knowledge.
I'd love to contribute.
Well why not call it gBasic as a nod to MS’s bundled favourite gw…?
Like you I started with Sinclair Basic (Spectrum), but professionaly I’ve created/maintained software in various Microsoft variants well into this century: Power…, Visual…, embedded Visual….
How about a compiler?
I think you have to make a linter now and code up a compiler lol. gonna need to get a dragon book. hahahaha thank you for posting!
yes to microcontrollers. the other basic interpreters/compilers handle all the other common tasks.
I'd like to see, (not just a small interpreter for the Pico), but a full-blown BASIC for the Pico called: pBASIC or PICO-BASIC.
BBC basic is already ported to the Pico
@@TheDarkelvenangel - I know that! But, it's limited, and Gary asked...so I responded.
You don't particularly need to name it "tiny" or "micro", etc. It could be "Gary's Wicked Basic" or GW Basic... oops, taken. Anyhoo, you could try a retroprogramming sort of thing. Make games and the like. Perhaps a standardized low rez screen output.
Good point about the name, thanks.
I suppose GazBas would be a bit self-indulgent. It's occurred to me that the definition of what BASIC is has gotten a bit fuzzy. We've had compiled BASIC, so that's not part of the definition. Removing line numbers and using labels is another (welcome) step away. When do all the extra functions stop being part of the language and become more like precompiled libraries etc. My feeling is, yes, nice little project but there are better alternatives out there now.
Ahhh, Sinclair BASIC that is what I started with, then Commodore, Quick Basic and Visual Basic although there is one additional one called "FREE" basic that I still have and play around with every now and then. If you look at your random number generator, some things never change, every other number generated is either an even number or an odd number. I remember modifying the Random number generator to stop things like this.Yes, my first "Laptop" was a Sinclair 1000 computer.
I like: itsy-bitsy BASIC
What i would actually like to see is a multi-platform BASIC compiler. The same BASIC source code would compile into computer specific machine code. Start with strictly text; that'll run on a ZX81, PET, BBC, Vic20, C64, etc.
geBasic, duh? We had gwBasic for a long time. Well done mate!
There are several good desktop/game BASICs like Freebasic or QB64 so what's the use of re-inventing the wheel (except for fun). But a good microcontroller BASIC would be very useful. Many would love to make IOT software with BASIC. Raspberry Pi BASIC with PLC style functions would be super!
GaryBASIC
That has a nice ring to it!!!!
...or Gazzic 😉
When I was writing code on my Enterprise 128 I hated the line numbers. Well done on removing them.
gBasic, having 3 synonyms; Gary (GaryBasic), Giddy (Meaning happy, GiddyBasic) and Gnat (A small insect, typically a pest, GnatBasic).
I think you could have some very interesting content if you produced a primitive specializing adaptive interpreter. It's a new approach that Python is moving to for version 3.11. I don't think there's a lot of people out there who have tried that before.
BASICally you change your interpreter to cache nformation about what it's interpreting alongside the program so you can speed it up.
You could also write a compiler for BASIC in BASIC and then use it to compile itself while running on your interpreter. For simplicity of demonstration you can emit C code instead of native.
Thus, you write a C code generator that takes BASIC as input. Then you provide it itself as the input and execute it in your current interpreter. Presto! A compiler written in its own language.
Writing line numbers seems far to tedious. Would be far be better to at least have "GOTO # display image". I also love that we didn't have to type PRINT because a question mark did the same. "Basically"... I'm far more into Python coding pixilation image generators that are most often not complex much as I am quite limited by the speed process.
Make it self-hosting: write a basic compiler in basic and have it build itself. Bootstrap using your interpreter :)
Always wondered why there is no an easy language like basic to create desktop applications? Something easy and old people like myself are familiar with!
Maybe as another step, to be able to link app’s written in Python, so Basic does the gui and event’s driven programming and python does the heavy lifting in the background
What language did you use to create the interpreter ?
C
Prize for the shortest reply!
When in doubt guess C.
Add internet connectivity functions. That was what was missing those days.
hi Gary ... thanks for the video .. francly i dont have a purpose for the code rightnow .... but the basics are the most important to me .... each line coud have the same story of Lazer .. and the name to me is Teatchy
gBasic for Gary's Basic! And do a basic that explain! Don't know how or why, but it seems like a good idea!
I am no pro coder and dislike Basic. However, I would suggest Peekaboo Basic -> Peekaboosic, depending on use case 😵💫
Maybe you can make it working for gpio and screens at the same time with different files
If I were to write a BASIC interpreter, it would be with a view to generate assembly code so that the radicals among us could then optimize that.
That would be a BASIC compiler not an interpreter! 😜
Gary, I sent you an email that you may find interesting. It is about the unusual features provided in a language interpreter from the distant past. The language was called BMIL.
Allow it to use libraries from C, C++, Java, and especially from Python!
Interpreted BASIC is largely useless. Yes, it’s literally the first thing I learned. AppleSoft BASIC offers more than your example, although it does require line numbers, and fit in less than 12K of ROM. Replacing line numbers with labels, and a decent text/program editor is a notable improvement.
That’s not a knock on BASIC. Compiled BASICs such as VB (DOS or Windows) are my preferred languages, because I can deliver about 95% of the performance of C(derivatives) and accomplish the task with 2x-5x less dev time. I’ve written real-time processing code in compiled BASIC, occasionally supplemented by some ASM or C routines for “bit twiddling”.
Given that, my opinion is this: It’s a neat project, and you should release it OSS, but unless it has a more complete feature set, AND is a JIT (or similar) compiler, I’m not sure you’ve added anything.😊
I did a follow up video, it is now called Piccolo BASIC.
When I created a language of my own, the purpose was to use it, and I do that all the time :-) Not the other way around.....
After thinking about it, for a while, i came to the conclusion, that you should go the microsoft way. Bundle your nanobasic together with your new operationg system for the nano and sell it. I see a market for it. Very interesting. Like to hear your answer.
I like the idea of developing it for games or desktop.
Develop it for the 6502 with RAM and ROM emulator from your previous video.
Porting it to a Raspberry Pi Pico is my first obvious choice of what you should do with it next! You should call it gBASIC for gary's BASIC... not sure how that would play out if you read it too fast...
Why not GEBasic?
Yes, I was thinking of that as well. Thx. 👍
Except that now thinking about more, GE is also General Electric, and I don't want any trademark disputes!
@@GaryExplains I was thinking on the play with GW BASIC, but just after dropping the comment I remembered GE could get bothered
I think how you meant to title this is that you forked an existing project and modified it. Back in the 90's when I first started with C I wrote a BASIC interpreter that had a built-in REPL, so line numbers were used to allow you to edit lines specifically, like the older interpreters did. The reason to start with 10 was so you could potentially insert 9 more lines in front of it, if needed. And thus the reason to use multiples of 10 should be self-evident, but I'll explain it anyway, you could insert new lines between the old lines you already wrote. I don't know who first decided to introduce "let" into imperative languages, but you should remove that. Either use context to determine assignment, like the original interpreters did, or go the Pascal route and use := for assignment.
I really like this idea… I would call it GEbasic... and while I like the idea of putting it to raspberry pi as an alternative to python which I hate… I think it would be really useful as a teaching language… Teaching folks how to write a interpreter individually a compiler… I think there are plenty of embedded languages blue among them… So I wouldn't go that direction… But in the spirit of Gary explains everything… I think it's a really good launching on point for everything having to do with the internals of interpreters and compilers including garbage collection native functions etc.… Nicely done… I continue to subscribe… Best wishes and continued success
I know by GEbasic you meant Gary Explains, but I wonder if General Electric ever had a version. I knew they were in the computer space and in the AOL, QuantumLink, CompuServe era they had a service called GEnie. A quick search did not turn up one, but it was surprising to learn that the very first version of BASIC, at Dartmouth, ran on the school's two General Electric computers!
Now that we have Python, there is no need for Basic.
That is a very valid point.
What microprogram and ISA?.
My preferred microcontroller at the moment is the Arm based Raspberry Pi Pico.
@GaryExplains right. Give it an element of AI capability like in java-8 by implementing lambda functionality, and your 'Basic' will be in great demand, I suppose.
Before I watched the video, I thought about having it on the Pico and calling it PicoBasic.
I am no expert, but maybe it could be added into the python interpreter?
How much of it did chatGPT write?
Open source your version, link to the original version, and if you're feeling particularly pedagogical, make some short videos explaining how and why you made each change. If that series proves popular (and/or you just enjoy doing it) then you can extend it by implementing the missing features.
I will likely do all that but that still doesn't give it a purpose.
@@GaryExplains Fun is a purpose.
Ever heard about Great Cow Basic ?
I hadn't, but I just looked it up... very interesting. 👍
Surely Gbasic, no wait.....
RIGHT! THE VERY FIRST PROGRAMMING LANGUAGE I LEARNT IN MY FIRST YEAR HIGH SCHOOL! QUICK BASIC LED ME TO LIKING COMPUTER OVER ARCHITECTURE 🤭🤗
It does tend though to leave people with the nasty habit of writing all caps!
Write a BASIC interpreter running on the BASIC interpreter.
Yes, self hosting would be cool, but not a priority.
Congratulation, I´ve done it already a while ago. Welcome to the club of real experts.
I thought I joined the club of real experts when I wrote a preemptive multitasking OS for the Raspberry Pi Pico! 😂
@@GaryExplains really? Or did you just port TRIPOS?
😂 No, but that reminds me, I must find my BCPL compiler! 🤪
@@GaryExplains oh man! I love you. You´re surely an expert.
😜
This is so awesome Gary, I would love to contribute towards developments of this project.
I see this being used to teach young people (high schoolers) about microcontrollers without really needing to learn a programming language.
May I suggest PicoBASIC
port it onto an arduino with little tft and keypad!
Good idea. Actually I ported it to the Raspberry Pi Pico and made a follow up video 👍
@@GaryExplains if u can get it into an arduino, many more people would have a go. save programs and run from sd card, we are all trying to do that. pi is an overkill.maybe mega 2560 or due.how about a nano!?would be a next level for arduino.write and run, yes yes yes...
Since the Pico only costs $4, then it isn't overkill.
no i mean pico pi is overkill in features and you need a whole opperating system to blink an led, no good to teach kids with!.... but Basic on an arduino...yes yes yes.@@GaryExplains
You don't need a whole operating system to blink a LED. 1) You can just use MicoPython (the modern equivalent of BASIC). It is interpreted and the interpreter runs on the board without an underling OS. 2) You can use Arduino!!! There is good support for the Pico in the Arduino IDE.
How about gxBASIC
Write a BASIC compiler in BASIC?
For the name of the interpreter, how about GE Basic? (i.e. Gary Explains BASIC)