top | item 45411071

(no title)

busfahrer | 5 months ago

Do you need flex/bison for something like this, or is it small enough that you can take some shortcuts?

discuss

order

TonyTrapp|5 months ago

Entire 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|5 months ago

Which, 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.

canpan|5 months ago

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