3 ms·
This looks really interesting, however a disadvantage is that the reader needs to know or learn a new programming language first T3X. I wonder if one could star
by AlexeyBrin 3y ago
This looks really interesting, however a disadvantage is that the reader needs to know or learn a new programming language first T3X. I wonder if one could start from scratch on a CP/M system: write and develop the compiler on a retro system that has no connection to the outside world except the keyboard and display.
- nils-m-holm 3y ago> however a disadvantage is that the reader needs to know or learn a new programming language first This is a good point, and I have thought about it a lot before starting the book. What finally made my choose T3X is that its compiler is much smaller[1] than my smallest C-subset compiler and (IMHO) T3X is easier to learn or understand. [1] SubC: 3815 lines, T3X/0: 2330 lines. Of course you could start on CP/M without any outside tools, but then you would have to write your bootstrapping compiler in assembly language. Time-consuming, but certainly manageable. I doubt that it would be an interesting reading, though.
- JonChesterfield 3y agoYou'd have some enthusiastic readers for writing compilers in assembly. Especially if you went down the route of progressively more capable assemblers. But "some" might be fewer than five.
- ramilefu 3y agoMake that six! I’m in!
- deleted 3y ago[deleted]
- mst 3y agoI don't see that as a disadvantage because (a) if you're planning to write a compiler, 'new programming language' is probably not something you're troubled by, and (b) having a simple+clean 'toy' language probably makes for better pedagogy. I'm -slightly- surprised it isn't using a C-like syntax rather than ALGOL-like but that's probably my own biases, and mentally mapping 'DO' and 'END' to '{' and '}' isn't much of a hardship.
- nils-m-holm 3y agoT3X dates back to the early 1990's, where C-style syntax was not as ubiquitous as it is now.
- mst 3y agoI'd apparently misguessed that the minilanguage was created for the book. Though if you'd care to share a link or something, I'm now curious how it -did- come to exist.
- nils-m-holm 3y agoI just wanted a simple language for writing down algorithms, so I think I hacked up the first version in one afternoon. It must have been T2, because AFAIR I never implemented T1. Here is a page containing some of the past T3X compilers: http://t3x.org/t3x/ http://t3x.org/t3x/ and here is an incomplete and inaccurate history of T3X: http://t3x.org/t3x/family.html http://t3x.org/t3x/family.html