Hacker News new | past | comments | ask | show | jobs | submit login
EndBASIC (endbasic.dev)
100 points by mpweiher on Sept 15, 2023 | hide | past | favorite | 22 comments



Hey, author of EndBASIC here. Surprised to see this bubble up to the front page again :D Previous discussion from June 2022 in: https://news.ycombinator.com/item?id=37495166

I did significant work on the project back then until Jan 2023... but I haven’t had a chance to work on it at all since then -- another side project (https://endtracker.azurewebsites.net/) is keeping me busy in my scarce free time. I still have many plans to work on this though, and they are itching because working on EndBASIC is super fun.

My next addition will probably be to pick up the Raspberry Pi I have around here and a tiny LCD I bought specifically for EndBASIC, and then make the console show up on it. Up next might be audio, or a “boot to EndBASIC” disk image for the Pi. We’ll see. Open to ideas.

More details in the about page (https://www.endbasic.dev/about.html) or in the EndBASIC section of my blog (https://jmmv.dev/tags/endbasic/).

Otherwise... AMA!



Oh yes, thanks. Bad copy/paste late at night.


AMA: How do you plan to go about the 'boot to basic' aspiration? Do you have a plan in your mind yet?

I'd be super interested in this.

I'd love to have or contribute to a computer that is instant on almost like the old BBC B's and Spectrum that opens to a basic interpreter but also gives you assembly access for those times basic just won't do. This should vibe with your DOS environment too.

There's no reason we couldn't have a BASIC ecosystem around that kinda like pico-8 but hardware.

With constraints comes creativity!

Thanks!!


Ideally I'd like to do a baremetal build... but... that's a ton of effort. In particular because of the cloud storage features, which would require network drivers, TCP/IP, and the like.

So the easiest plan of attack is to build an image with a Linux kernel (a BSD would be my preference though!) and essentially put EndBASIC as the init process. Obviously not exactly like this, because there needs to be some sort of setup steps and tools to get the network going and the like, but there is no need for much more. Eventually though, you'd even imagine built-in BASIC commands to manipulate the WiFi, bypassing the need for external tools.

As for assembly, I have conflicting thoughts there. Since I moved the interpreter to bytecode at the end of last year, I _do_ want to expose direct access to the "assembly" language and memory from the interpreter (PEEK and POKE!). But due to the multiplatform and didactic nature of EndBASIC, exposing the underlying assembly (x86, arm, etc.) doesn't seem the right idea. What I'm thinking is to compile to WASM everywhere, and leverage the WASM VM in the browser and implement a simple one for the console. But the other alternative is RISC-V... and both are tempting.


Thanks for sharing your thoughts.

Yeah bare metal is hard that's why it made me sit up a bit when I read your comment.

PEEK AND POKE was precisely what I was thinking of!

I guess there could be a layer of psuedo-assembly that has a common target across platforms but easier said than done. WASM is interesting and RISC-V just got my mind racing which lead to thinking about FPGA's etc!

Sorry, getting a bit carried away these are just thoughts not requests :D

but how cool would it be to have a RISC-V processor either on or coupled with an FPGA for 'ROM' that booted directly into Endbasic and gave bare metal access.

You're talking full time team there though probably or certainly someones life work.

EDIT: Sorry I somehow missed your second paragraph re: linux init etc which makes a ton of sense.

A long time ago a crazy friend and I tried to write a wifi 'driver' for BBC basic using the socklib library and got surprisingly far (in emulation).


Perhaps a unikernel based on something like mirageos or another unikernel people would suggest here?


Perhaps. Or https://en.wikipedia.org/wiki/Rump_kernel also comes to mind.


It's elixir, but this provides a lot of nice tooling https://nerves-project.org/


RISC OS is still available for the Raspberry Pi. You get to basic by pressing F12 and typing ‘BASIC’, and it has a built-in ARM assembler already - the manuals are all available online, there’s a BASIC manual and the Programmers Reference Manual for the whole OS.

(It’s exactly like a BBC B because this is the same version of BASIC, ported to ARM, it even emulates some of the hardware because back in the day they wanted to make software run without porting)

In theory typing ‘*CONFIGURE LANGUAGE 20’ (BASIC being module 20) should make it into a machine that boots straight to BASIC but when I tried it just now it just ignores the setting because the keyboard drivers aren’t loaded soon enough.


"but it can also feel lacking in some scenarios"

Just curious: what features are available in QB but not available (yet) in EB?


Many, really. QuickBASIC is very complete. You can easily install it in DosBOX to take a look, or download QB64 (https://qb64.com/) for a similar but more modern experience.

Some specifics that are in my mind as "must haves" are user-defined functions, file I/O, records (aka structs), syntax checking / interactive help in the editor...


Slightly buried: Apache 2.0, written in Rust, https://github.com/endbasic/endbasic/

Definitely an interesting attempt to cut through layers of abstraction and make something that lets people make the computer do useful/interesting things. No idea how well they realize that vision, of course, but good idea.


How does this compare to FreeBASIC? https://www.freebasic.net/


I haven't used FreeBASIC, but from the looks of it, it's a much more complete language.

EndBASIC, OTOH, is much newer and limited as a language right now. The main difference is that EndBASIC offers you an _environment_, not just a language interpreter, so that you get a full retro-machine experience. Plus EndBASIC runs in the browser too, making it much more approachable from any device.


Hi; I'm an occasional contributor to FreeBASIC but have only had a brief look at EndBASIC and agree, these are in two different categories, they're not just different languages. Cool project!

FB is a compiler, almost fully QuickBASIC compatible (only when set to the qb 'dialect') but also competing with general purpose languages (I like to describe FB as a subset of C++98 with BASIC syntax and lots of BASIC additions like decent strings, but many FB users would be offended by any comparison to C++); EndBASIC is as you say. Without QBASIC's interpreter and environment FB is really missing part of the magic of QB. FB does compile to the browser via Emscripten, to DOS, and even to bare metal, but that's still very different from EndBASIC.


Wow! I use a flavor of BASIC called Rocky Mountain BASIC on an HP UNIX workstation for my job. At first, I was absolutely miserable that I was wasting my time trying to learn this ancient language, but I have learned to appreciate it more because of its historical significance. I'll definitely be checking out EndBASIC.


Cool.

I can sort of understand massive banking systems still running on COBOL, I would have thought basic programs small enough to replace. It looks like it's actually embedded in test equipment though?

What kind of basic are we talking about

20 goto 10? Or something more modern?


Ha, yeah GOTO statements are littered throughout the code I have to maintain. And, yes RMB was developed for automating test setups. Developed by Hewlett-Packard decades ago when they were still in the business of manufacturing test equipment for RF/microwave system testing.


  do : if int(rnd(1)) * 2) = 0 then print "\\"; else print "/"; : loop


Indeed, but the iconic version of this is slightly different (and it should work too). I kinda enjoyed reading the https://10print.org/ book last year and... https://twitter.com/jmmv/status/1595431339603660800 :)


  READY
  GRAPHICS 8; COLOR 1




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: