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 .
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 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).
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
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.
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 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.
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.
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?
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.
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.
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.
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.
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 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.
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
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 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.
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
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
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...
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.
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!
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.
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….
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
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.
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.
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.
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.
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.
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.
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?
Some way to pass off some part the code to a compiler or assembler would be cool, so you can speed up crucial routines (especially if you wanna go down the game making route). "Fun Sized Basic" is a funny name. I think.
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...
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.
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. 👏👍
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.
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.
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 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.
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.