Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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


You'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.


Make that six! I’m in!


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


T3X dates back to the early 1990's, where C-style syntax was not as ubiquitous as it is now.


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


I 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/ and here is an incomplete and inaccurate history of T3X: http://t3x.org/t3x/family.html




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: