top | item 31651881

EndBASIC

152 points| tosh | 3 years ago |endbasic.dev

118 comments

order
[+] jmmv|3 years ago|reply
Author of EndBASIC here. Surprised to see this show up on the front page today. AMA!
[+] lokedhs|3 years ago|reply
This 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.

[+] yumaikas|3 years ago|reply
Do 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.
[+] snorkel|3 years ago|reply
Glad it has graphics! Always the best part of BASIC
[+] simonmic|3 years ago|reply
Great choices, amazing execution! Thanks for all the hard work. I will be sharing this with my nephews.
[+] mysterydip|3 years ago|reply
As 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?
[+] guessbest|3 years ago|reply
Congrats! How do you keep your site from crashing with all the traffic? I assume you must be serving up a lot of javascript
[+] 97-109-107|3 years ago|reply
This is interesting. What was your motivation to build this?
[+] nonethewiser|3 years ago|reply
What did people do before dictionaries, maps, etc?
[+] RachelF|3 years ago|reply
Why no line numbers?
[+] behringer|3 years ago|reply
BASIC 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

[+] pjmlp|3 years ago|reply
Structured 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.

[+] abnercoimbre|3 years ago|reply
The 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/

[+] jmmv|3 years ago|reply
Making 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
[+] nsxwolf|3 years ago|reply
It 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.

[+] wellpast|3 years ago|reply
This 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.
[+] whitten|3 years ago|reply
Interesting. Please provide some syntax pages beyond using the HELP command interactively to find out what the possibilities might be.
[+] whitten|3 years ago|reply
I 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?
[+] hoistbypetard|3 years ago|reply
When 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?

[+] gushie|3 years ago|reply
I 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
[+] jmmv|3 years ago|reply
The console is hand-crafted and implemented as an HTML or SDL canvas to support rendering text and graphics at the same time. I haven't implemented text selection nor copy/paste on top of that yet (and it isn't in my list of priorities right now because, well, you didn't have a mouse in the old BASIC interpreters anyway ;) ).
[+] cies|3 years ago|reply
I 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).

[+] anonymousiam|3 years ago|reply
"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!

[+] jmmv|3 years ago|reply
I 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.
[+] yyyk|3 years ago|reply
The 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.
[+] pjmlp|3 years ago|reply
Indeed, that is why they were written in Assembly.
[+] Cyder|3 years ago|reply
I 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.
[+] dspillett|3 years ago|reply
> I've never been able to find a version if basic that had that graphics capability.

If you are looking for a retro BASIC, then BBC BASIC had line and filled triangle drawing built in (or it was in the system ROM and BASIC had hooks for it). There was an extension (IIRC separately purchased for the Model A & B, built into the BBC Master) that added rectangles, circles, and ellipses.

BBC Basic was the best of the 8-bit offerings for learning on as it supported named procedures and functions, and a few other structural features (some BASIC implementations at the time didn't even have ELSE with their IF statements). There were significant limitations, but it was massively ahead of the GOTO/GOSUB (which it also had of course) that were your only option in BASIC interpreters on other home micros. It also supported variable names of reasonable length (40 characters IIRC, you could actually use more but any after 40 were silently ignored and you didn't want really long variable names anyway as they would take too much program space to store) where some other BASICs limited you to just a couple of characters. It even had a built-in multi-stage assembler for when you wanted a bit more oomph than interpreted BASIC could offer.

[caveat: one or two of the above features may not have been present in the very original version, though I think they were all in BASIC II that appeared in 1982]

[+] jll29|3 years ago|reply
Nice 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/ ).

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).

[+] jhbadger|3 years ago|reply
BASICA (IBM PC-DOS) and GWBASIC (Microsoft MS-DOS) were functionally identical. MS-DOS was just the version of PC-DOS that Microsoft released for non-IBM hardware. Not sure why the basic command was renamed.
[+] ForOldHack|3 years ago|reply
ok. 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?

[+] wiz21c|3 years ago|reply
Reminds me of Gambas sort of
[+] ChicagoDave|3 years ago|reply
Without line numbers, GOTO, GOSUB, and/or SUB/FUNCTION, this is a very raw (and mostly unusable) version of BASIC.
[+] bmacho|3 years ago|reply
Send text as image because reasons. No thanks.
[+] khazhoux|3 years ago|reply
A man implemented BASIC.

He did not support '10 PRINT "HELLO"'

He did not implement BASIC.