Earlier quoted context omitted.
> one of the fun things about it was that I kept the ability to intersperse assembler instructions everywhere - they were treated as normal statements. And the M68k registers were first class variables in the language that could occur in any expression. That sounds like so much horror and so much fun at the same time.
BBC Micro Basic let you interpose assembler in the middle of the program - although it was a two-pass assembler and you had to call both passes seperately with a small FOR loop if you wanted labels to work.
Creating a language using only assembly language
31–40 of 67 posts
Re: Creating a language using only assembly language
#32Re: Creating a language using only assembly language
#33This is kind of like a mix between the two. I like how the author illustrates each step well. The best illustration is showing how easily the core language can transform into a mainstream-grade language with extensible syntax and macro's. A strength worth copying in any new language albeit with guidelines on proper use. I bet it was all pretty fun, too.
[1] http://www.cfbsoftware.com/modula2/Lilith.pdf
[2] http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=E0F...
Re: Creating a language using only assembly language
#34Step 1: Make a language high-level enough to build a parser without being a masochist. Step 2: Make a lisp. Step 3: Do it all in lisp. Step 4: Profit. Even Amber( https://github.com/nineties/amber ) and its syntax looks a lot like lisp concept of grammar. But instead of (s expressions) you've got what is very similar to M[expressions] ( https://en.wikipedia.org/wiki/M-expression ). It's amazing what you can with Lisp…
Competition has gone down from the 70's and 80's, though. I remember reading a Scheme paper that builds a software interpreter then implements the thing in hardware too. There were also people doing HLL-to-microcode compilers to cheat extra performance out of their chips. These days most projects stop at assembler. I'd love to see people whip out their FPGA's and start trying to outdo 70's-80's era innovation in hardware/software designs maybe for modern languages.
One of my concepts collecting dust is the Secure Python Target that merges a capability machine, LISP-like hardware at core for native bytecodes, and compiler from Python to that language. Result could be quite productive, reliable, and secure. Another was a Secure Haskell (or ML/Ocaml) Target. I don't know that kind of stuff as well, though. Python has enough documentation, community, and simplicity (to a degree) that academics could port some of its core to hardware.
Re: Creating a language using only assembly language
#35Re: Creating a language using only assembly language
#36Ok. I'll toot my own horn. In ~1983 I wrote the first iteration of Sensible Solutions for O'Hanlon Computer Systems using MASM. Of course, it had to run in less than 64k. Basically, it was a VM that would run pseudo code. And, the compiler was written in ASM also. In 1985 I wrote TAS, again using MASM. Again, a VM. The language it compiled (in both cases) was written to create business accounting applications, which…
I used to do some assembly on 68000, 6502 and some Z80. It's nice to have those simpler CPUs and the simpler hardware to learn an assembly language on.
Re: Creating a language using only assembly language
#37Earlier quoted context omitted.
Is it this project? http://matt.might.net/articles/implementing-a-programming-la...
Nope, I remember numbered evaluators like lc-0 lc-1. Thanks anyway.
Re: Creating a language using only assembly language
#38Step 1: Make a language high-level enough to build a parser without being a masochist. Step 2: Make a lisp. Step 3: Do it all in lisp. Step 4: Profit. Even Amber( https://github.com/nineties/amber ) and its syntax looks a lot like lisp concept of grammar. But instead of (s expressions) you've got what is very similar to M[expressions] ( https://en.wikipedia.org/wiki/M-expression ). It's amazing what you can with Lisp…
Yeah, it's kind of a cheat. A real language built in assembler would be headaches and I bet a HLL prototype would be hidden somewhere. HLA might be doable, though, especially if macro's are used diligently for pre-optimization work. Competition has gone down from the 70's and 80's, though. I remember reading a Scheme paper that builds a software interpreter then implements the thing in hardware too. There were also p…
Depending on what you consider a "real language", it's not that bad. I did a Forth in 80x86 assembler years ago, and it was reasonably easy and fun.
(I did use the BIOS routines for keyboard/screen I/O...they were one character at a time, IIRC).
Re: Creating a language using only assembly language
#39Earlier quoted context omitted.
Parsing LISP in assembly isn't even so hard. Without a lot of syntactic symbols, you're just finding whitespace and parens. Even syntactic sugar like ' for quote and , or @ in macros are pretty simple to parse compared to C or -- code gods forbid -- C++. What I'd dread is writing the garbage collector in assembly. Maybe you could rely on reference counting, but that could still be a mess.
> What I'd dread is writing the garbage collector in assembly. Maybe you could rely on reference counting, but that could still be a mess. You don't have to write the final Lisp in assembly; you write the first Lisp in assembly, and the final Lisp in Lisp.
Re: Creating a language using only assembly language
#40Earlier quoted context omitted.
Yeah, it's kind of a cheat. A real language built in assembler would be headaches and I bet a HLL prototype would be hidden somewhere. HLA might be doable, though, especially if macro's are used diligently for pre-optimization work. Competition has gone down from the 70's and 80's, though. I remember reading a Scheme paper that builds a software interpreter then implements the thing in hardware too. There were also p…
"A real language built in assembler would be headaches" Depending on what you consider a "real language", it's not that bad. I did a Forth in 80x86 assembler years ago, and it was reasonably easy and fun. (I did use the BIOS routines for keyboard/screen I/O...they were one character at a time, IIRC).
Cool that you assembled one, though. (pun intended)