Let’s make a Teeny Tiny compiler https://austinhenley.com/blog/teenytinycompiler1.html
I Wrote a Compiler
11–20 of 78 posts
Re: I Wrote a Compiler
#12I thought a compiler, with no adjective or caveat, should turn a HLL into machine language. Isn't what this describes—turning BASIC into Go—more accurately described as a "pseudocompiler" or "Go compiler" or somesuch? I know Emacs is always said to have a "bytecode compiler" that processes Elisp code, not a "compiler" per se. Am I mistaken?
Re: I Wrote a Compiler
#13Re: I Wrote a Compiler
#14TinyBASIC is fun and beautifully simple. I wrote a 3-part tutorial for making a TinyBASIC-to-C compiler using Python a few years ago. Let’s make a Teeny Tiny compiler https://austinhenley.com/blog/teenytinycompiler1.html
Re: I Wrote a Compiler
#15Re: I Wrote a Compiler
#16Re: I Wrote a Compiler
#17I thought a compiler, with no adjective or caveat, should turn a HLL into machine language. Isn't what this describes—turning BASIC into Go—more accurately described as a "pseudocompiler" or "Go compiler" or somesuch? I know Emacs is always said to have a "bytecode compiler" that processes Elisp code, not a "compiler" per se. Am I mistaken?
The standard term for this kind of compiler is "transpiler", afaik. Here's the Wikipedia page for such things, which also taught me several other names for them: https://en.m.wikipedia.org/wiki/Source-to-source_compiler
Re: I Wrote a Compiler
#18Don't we all? ;-)
Re: I Wrote a Compiler
#19>The original authors of yacc were Mike Lesk and Eric Schmidt - yes that Eric Schmidt. Incorrect, they were authors of lex. yacc was authored by Stephen Johnson. Surprising to me is all the authors are still around, even though the tools are over 50 years old!. Shows how young computer science field is.
Re: I Wrote a Compiler
#20TinyBASIC is fun and beautifully simple. I wrote a 3-part tutorial for making a TinyBASIC-to-C compiler using Python a few years ago. Let’s make a Teeny Tiny compiler https://austinhenley.com/blog/teenytinycompiler1.html
I know BASIC is kind of a “bad” language, but there’s something so delightful about it. If we’re plugging TinyBASIC projects that others might find interesting, I made an MMO TinyBASIC REPL the other day: http://10klob.com/
I think the closest modern equivalents might be Python (for easy onramp and scalability from microcontrollers to supercomputers) and JavaScript (for pure ubiquity in every device with a web browser.)
I wonder if there is a modern-ish (?) environment that can match Visual BASIC in terms of easy GUI app programming. Perhaps Python or Tcl with Tk (Qt seems harder) or maybe Delphi, or perhaps a modern Smalltalk.