4 ms·
Coincidentally I implemented a TinyBasic in C recently. Based on DrDobbs journals first issue. I ported HAMURABI over to it (I only have int math and some other
by canpan 1y ago
Coincidentally I implemented a TinyBasic in C recently. Based on DrDobbs journals first issue. I ported HAMURABI over to it (I only have int math and some other parts were different). It is a great weekend project. Recommend.
- busfahrer 1y agoDo you need flex/bison for something like this, or is it small enough that you can take some shortcuts?
- TonyTrapp 1y agoEntire BASIC interpreters were shipped in the very size-constrained ROMs of almost all home computers of the 80s. There was no luxury of parser generators. It's absolutely simple enough that you can write the lexer and parser yourself.
- pjmlp 1y agoWhich, for historical context, is why while Dartmouth BASIC compiled to native before execution, all the 8 bit home computer systems with ROM BASIC were contrained to be plain interpreters. Although those with machines powerful enough to run CP/M, and having disk drives, could enjoy the access to compilers.
- musicale 1y ago> Although those with machines powerful enough to run CP/M, and having disk drives, could enjoy the access to compilers. Like the remarkable Turbo Pascal, which crammed a full IDE into 34KB.
- canpan 1y agoI built it as a plain single C file. You can find DrDobbs journal Vol 1 from 1976 with implementation ideas in the internet archive. It is a very retro approach. Just a fun side project. I am sure there are better ways to do it.