7 ms·
Author of EndBASIC here. Surprised to see this show up on the front page today. AMA!
by jmmv 4y ago
Author 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.
- dusted 4y agoPart of why we need huge libraries to put graphics on the screen is because those amazing graphics cards have comparatively large and complicated interfaces.
- abainbridge 4y agoHaving a bitmap in normal system memory that we can write to the window or screen is easy though and should be more widely supported. Once you've got that you can write pixels, lines, rectangles, mandlebrots etc very easily and building up to a GUI toolkit is also quite easy and fun. This mechanism is fast enough for pretty much everything other than games on modern hardware. I consider GPU acceleration a form of premature optimization - it adds complexity unnecessarily in many cases. Here's my library for doing that on Windows and X11. https://github.com/abainbridge/deadfrog-lib https://github.com/abainbridge/deadfrog-lib
- 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.