11 ms·
EndBASIC
- TheHideout 4y agoVery cool. I have a ton of old qbasic/freebasic projects that would be fun to give them life again on the web. http://syn9.thehideoutgames.com/ http://syn9.thehideoutgames.com/
- 38_9503-94_5201 4y agomarik.
- 38_9503-94_5201 4y agodan ie l.
- wiz21c 4y agoReminds me of Gambas sort of
- jmmv 4y agoAuthor of EndBASIC here. Surprised to see this show up on the front page today. AMA!
- 97-109-107 4y agoThis is interesting. What was your motivation to build this?
- jmmv 4y agohttps://www.endbasic.dev/about.html#retro https://www.endbasic.dev/about.html#retro
- mysterydip 4y agoAs an avid BASIC enthusiast I love the concept! What did you envision as the use case for when you're feature complete? Just a toy or something more?
- jmmv 4y agoI was mostly targeting the ability to write some simple games that combine graphics, some peripheral input, and sound. Mostly a toy though, but who knows: the future is unchartered :)
- snorkel 4y agoGlad it has graphics! Always the best part of BASIC
- jmmv 4y agoIndeed. The difficulty in manipulating graphics is what most puzzles me these days. We have these amazing graphics cards and screens, but all we can do is output text by default in most languages, and drawing anything requires large libraries or SDKs.
- 7thaccount 4y agoThat blows my mind as well. You'd think I'd be able to write some pretty cool games using just PowerShell on Windows calling out to native graphics functions.
- simonh 4y agoIt is possible to access windows API functions from Powershell, but it's not particularly simple. I think you can define a method that calls an API function? Alternatively you can go via C#. In theory you could access the DirectX primitives that way. DX is a pretty low level API though. Unreal and Unity exist for a reason.
- zozbot234 4y agoDrawing modern graphics is not done by blitting pixels onto a framebuffer, which is the model most BASICs use. In fact, doing pixel-perfect 2D rendering on GPU is still hard and an area of active research.
- abainbridge 4y ago> Drawing modern graphics is not done by blitting pixels onto a framebuffer That's a choice. The hardware still supports it. It is still possible (and fast-ish and simple) to do graphics by blitting pixels.
- 4y ago
- guessbest 4y agoCongrats! How do you keep your site from crashing with all the traffic? I assume you must be serving up a lot of javascript
- jmmv 4y agoIt's all client-side, unless you use the cloud service to fetch the tiny programs that are shared, like this one: https://repl.endbasic.dev/?run=jmmv/bounce.bas https://repl.endbasic.dev/?run=jmmv/bounce.bas -- and those requests are cheap and infrequent right now. The current wasm file that's downloaded is just about 1MB!
- anthropodie 4y agoMay I know the language that was used to create wasm file?
- speed_spread 4y agoProbably Rust, since that's what the project is written in.
- nonethewiser 4y agoWhat did people do before dictionaries, maps, etc?
- qiqitori 4y agoC doesn't have that either. Most commonly people just do a linear search. If you have a bigger array you can either use a library or roll your own almost-hash table-kinda-thing. It's not that complicated to roll your own because you already know your specific type of input. Implementing something that works for "any" type of input is harder.
- haroldl 4y agoI worked on a C project where we counted 14 different hash table implementations done for different key/value data types strewn through the code.
- pjmlp 4y agoWe read books about data structures and algorithms, implemented our own libraries that we carried from project to project. Alternatively, we would buy a library from companies selling developer tools.
- tgv 4y agoYup. I still have avl trees from way back lying around. I've ported them to C++ and recently to Go.
- rwmj 4y agoI wrote some (what would now be called "CRUD") applications back in the 80s in BASIC and later in C, and the answer is arrays and linear searches. 80s BASIC wasn't able to store more than, say, 100-500 user records, so linear searching was fine, even in an interpreted language. If you wanted to get really fancy you might have used something like JETSAM which gave you a single key-value db in a file.
- yumaikas 4y agoDo you have any plans on adding hashtables/dictionaries of any sort to the language? It seems to be above the cutting-off point for some other retro basics I've seen, like QB64. Perhaps it's too complicated to add, but they feel kinda like part of the bedrock of "scripty" languages these days, so it's something I'd definitely add if I was making a BASIC myself, but I understand that different folks take different tacks on stuff like this.
- hahajk 4y agoOne of my favorite parts of these simple languages is implementing more advanced data structures myself!
- jmmv 4y agoHadn’t thought about it at all, so no plans. But maybe? First I have to get to records and then we will see :)
- tgv 4y agoAWK has associative arrays, but no structs. It's a pretty useful language, although it has rather different use cases, of course.
- lokedhs 4y agoThis looks really neat. I played around with it a bit and it's very intuitive to use. If I could make a single request, it would be to be able to have white background. As someone with heavy astigmatism, using the site as is is very difficult, and I can only look at the screen for a few seconds at a time without my vision getting blurry. I know I can use the color command to change it in the repl, but the editor still uses black background.
- zik 4y agoI like the black background. It reminds me of the old days, running MS BASIC on an original 8086 PC.
- jmmv 4y agoThanks for the suggestion. I've never liked keeping some of these settings hardcoded and wanted to provide some kind of configuration file to tune them. Knowing that there is an important usability issue around them helps prioritize. I've filed https://github.com/endbasic/endbasic/issues/181 https://github.com/endbasic/endbasic/issues/181 to track.
- lokedhs 4y agoThanks a lot. It's appreciated. Would like to try to introduce my kids to Basic using this application.
- RachelF 4y agoWhy no line numbers?
- speed_spread 4y ago10 PRINT "There's a fine line to walk between authenticity and masochism" 20 GOTO 10
- jmmv 4y agoBecause at the onset of the project, I favored implementing structured programming constructs (if, while, for) and ended up with an AST evaluator for the execution engine, which makes it hard to retrofit GOTOs in it. Some form of jumping or function calls is the main feature that will drive the next release.
- tommica 4y agoI guess this is a bug? https://postimg.cc/3drWBJm6 https://postimg.cc/3drWBJm6 I just edited the bouncing ball example and set "n = 200*200"
- tgv 4y agoThere's a limit to the number of colors. It almost certainly doesn't go up the 40k. Perhaps add a modulo operator to the color statement?
- jmmv 4y agoCorrect. They go up to 256. The numbers map to the "typical" X11 colors and the table is here: https://github.com/endbasic/endbasic/blob/ac3eb5622a6db0beb4161d88e883d692e20cda1d/std/src/console/colors.rs#L22 https://github.com/endbasic/endbasic/blob/ac3eb5622a6db0beb4... I've thought about adding other ways of specifying colors, like COLOR "#aabbcc". Would that be useful/interesting?
- tgv 4y agoPeople will like it, but i’d not use that format: it’s cumbersome. Instead, you could try eg. COLOR r,g,b Or add CSS like functions: COLOR rgba(…)
- simonmic 4y agoGreat choices, amazing execution! Thanks for all the hard work. I will be sharing this with my nephews.
- behringer 4y agoBASIC languages seem to be having a bit of a renaissance year. There have been about (that I know of) 2 or 3 new BASIC languages introduced just this year alone. I absolutely love the idea of a modern web based BASIC as I can work on the road from anywhere! I've added a room for this to my BASIC oriented discord, hopefully this doesn't seem spammy it's the only one around on the subject of BASIC in general, as far as I'm aware: https://discord.gg/HQaDgJvbbJ https://discord.gg/HQaDgJvbbJ
- pjmlp 4y agoStructured BASICs are great. Not only they were quite productive as dynamic languages, they also had optional typical and AOT compilation, besides the rich libraries for start coding right away. One thing that many might be unaware is that the original Dartmouth BASIC was actually JIT based, the pure interpreted versions only came to be due to fitting it into 8 bit home computers.
- eatonphil 4y agoMy concern with attempting to learn BASIC is that at least the big ones aren't garbage collected (freebasic, qb64). In the first place (not growing up using BASIC) I don't understand how BASIC got so big as a programming language for beginners (even kids) without a GC. Or maybe my searches just haven't turned up the right implementation or something. I have the same issue with (Free)Pascal but I'm less surprised there because it's not like (apparently, since like I said this wasn't me) everyone as a kid learned to game program with Pascal the same way they did with BASIC.
- whitten 4y agoInteresting. Please provide some syntax pages beyond using the HELP command interactively to find out what the possibilities might be.
- whitten 4y agoI tried to move the cursor and then print at that location through the command line. How do you separate two commands on the same line to do this in the repl?
- jmmv 4y agoUse a colon to separate statements. LOCATE 5, 5: PRINT "Hi" should do the trick.
- jmmv 4y agoTake a look at the docs page in the website (https://www.endbasic.dev/docs.html https://www.endbasic.dev/docs.html) and the demos at the top of the gallery (https://www.endbasic.dev/gallery.html https://www.endbasic.dev/gallery.html).
- hoistbypetard 4y agoWhen I typed '10 ? "hello, world"' it got angry. That violates all my expectations of a BASIC :) Also, is there a good reason the REPL won't let me select, copy and paste text?
- jmmv 4y agoYeah, there are no line numbers (although 0.3 had them!) nor GOTO. I think this is the main thing I'll add in the upcoming 0.10 because it's what everyone asks for :) https://www.endbasic.dev/docs.html#lang-goto https://www.endbasic.dev/docs.html#lang-goto
- yebyen 4y agoI imagine it would be pretty interesting to graph the data on how many people tried what incantations first 10 print "hello" has GOT to be the leader.
- gushie 4y agoI spent 20+ years in my day job programming in BASIC on OpenVMS without using line numbers or GOTO's. Yet the first thing I did here was fall back to my childhood Sinclair/BBC BASIC of trying 10 PRINT "Hello" 20 GOTO 10
- dharmatech 4y agoCan you talk about what you worked on in BASIC on VMS?
- pjmlp 4y agoIt was quite advanced BASIC, so I imagine any kind of business application. https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na-c04619693 https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na...
- dharmatech 4y ago
- nsxwolf 4y agoIt has no line numbers, fine. But I couldn't figure out how to enter a program since it doesn't present an editor. All my commands were executed in immediate mode. I probably would have spent a little more time with it if it had been obvious how to enter a program without poring through documentation. I did load the DEMO program, maybe it was in there, but I missed it.
- stef-13013 4y agoGFA revival ?
- wellpast 4y agoThis is how I learned to code. I cannot imagine throwing a kid in front of a Javascript browser console or modern IDE and say figure it out. This is so awesome -- with the low-res graphics, too! If my kids learn to code, this is how my kids will learn to code.
- ChicagoDave 4y agoWithout line numbers, GOTO, GOSUB, and/or SUB/FUNCTION, this is a very raw (and mostly unusable) version of BASIC.
- jmmv 4y agoThis is what's coming next. I've so far been carried away building the environment around the tiny language, but it's time to start making the language usable -- and user supplied functions are the very next work item to complete.
- eatonphil 4y agoHave you decided on the plan of attack? Switch to a VM or something more fun in the AST evaluator? :)
- jmmv 4y agoNot yet. I'm tempted to add custom functions first for which the AST evaluator should be sufficient. And anyway, even though not as retro, named functions are better than a mess of numbered GOSUBS... Which means that if I even get to GOTO/GOSUB, I may try to do it in a hacky way. Although, to be honest, in the spirit of making this a true "retro-computer", the idea of compiling the code into a custom bytecode is incredibly tempting. It'd be super fun to build, and also... that'd enable a DISASM command of some kind to dump arbitrary memory, as well as PEEK/POKE! Tons of work though.
- eatonphil 4y ago> Tons of work though. You know your project better than I do but unless there's something I don't understand going on, it really shouldn't be that hard. You can also keep both backends around and just build a basic VM evaluator and start compiling simple expressions at a time to the VM version. I don't want to give you suggestions if you already know all that but also happy to chat if you are looking for a good plan. :D
- khazhoux 4y agoA man implemented BASIC. He did not support '10 PRINT "HELLO"' He did not implement BASIC.
- bmacho 4y agoSend text as image because reasons. No thanks.
- Cyder 4y agoI first programmed using basica on an IBM dual 5.25 diskette PC but have not been able to find it or an emulator. I did graphics programming with it using commands like line (0,0)-(100,200). I've never been able to find a version if basic that had that graphics capability. I loaded it from Dos typing 'basica'. Anyways, great language to learn on.
- jmmv 4y agoEndBASIC has graphics support. Not with that syntax, but hopefully similar enough. You can try things like this: GFX_LINE 100, 100, 200, 200 GFX_RECTF 300, 300, 400, 500
- jll29 4y agoNice exercise developing an embeddable BASIC interpreter in Rust. I've experimented with teaching 11-year old school children Python in a single session. To obtain the immediacy effect that the original poster mentioed (which reportedly were liked by his kids), I use Turtle graphics module inspired by logo (import turtle - see also https://vegibit.com/how-to-move-the-python-turtle/ https://vegibit.com/how-to-move-the-python-turtle/ ). Here's what you can do in a single two-hour session: 1. First I explained the children how points can be addressed using x and y coordinates (Cartesian coordinate system - which they hadn't had in maths classes at the time). "Each dot has two numbers that indicate where it lives, like house numbers." 2. Then I gave them the task of drawing a house only using straight lines (no curves permitted). 3. Next I asked them to convert the lines that made up their house into Python code based on forward(), right() etc. commands inspired by LOGO (which was, after all, inspired by education work with children ast MIT). 4. Let them try out their program on a computer. 5. Tell them that if they liked this exercise, they should ask for a Rasberry PI from their parents as a Christmas present as an affordable way to get into programming (early).
- lproven 4y agoWhy not actual Logo, as this is exactly what it was designed for? https://el.media.mit.edu/logo-foundation/resources/software_hardware.html https://el.media.mit.edu/logo-foundation/resources/software_...
- int_19h 4y agoFor those who want the "real deal" when it comes to features that old BASICs had, and don't care about the web angle, try this: https://robhagemans.github.io/pcbasic/ https://robhagemans.github.io/pcbasic/
- deleted 4y ago[deleted]
- anonymousiam 4y ago"Built entirely in Rust with a minimalist modular design. Open source. Embed the interpreter into your own programs for just 700KB" Back when QuickBASIC was a thing, 700KB was an enormous amount of memory. The early IBM PCs (which included a BASIC interpreter in ROM) maxed out at 640KB!
- deleted 4y ago[deleted]
- pjmlp 4y agoIndeed, that is why they were written in Assembly.
- yyyk 4y agoThe original BIOSs were for a 8bit/16bit archs. I'm guessing this was measured on a modern arch, and the result would be smaller on a smaller pointer size. I wonder what the size would be if complied for avr.
- jmmv 4y agoI know, I know. And the Amstrad I had with Locomotive Basic only had 128k of RAM and (as I read now) 48kb of ROM -- yet it fit the whole language in there, which was more complete than what EndBASIC currently offers. But things have changed, and I still think that 700kb nowadays is reasonably small all other things considered.
- cies 4y agoI feel nostaliga with this. Though I much prefer a unix CLI nowadays (like bash or zsh) and would choose something like Ruby over BASIC in all cases. I felt MS-DOS and QBASIC held me back by not being opensource (thus not allowing me to dig deeper).
- abnercoimbre 4y agoThe author has a 5-minute polished demo [0] from last year's Handmade Seattle (also featured in EndBASIC's Gallery page.) [0] https://media.handmade-seattle.com/endbasic/ https://media.handmade-seattle.com/endbasic/
- jmmv 4y agoMaking that demo was tough but pretty rewarding in the end! I ended up featuring it in the About page of the site because it’s a great intro to what EndBASIC is supposed to be :D
- ForOldHack 4y agook. Basic. When did you parents learn to read? I have been programming in BASIC since 1970. I programmed it through primary school, middle school, jr high school, and high school, and took it in college. Almost all on a HP2000. (five different machines). Is there a set of test programs for basic?