This commit is contained in:
Miloslav Ciz 2025-03-22 08:02:47 +01:00
parent 390c8b8a4c
commit 3d11ef05d8
36 changed files with 2003 additions and 1984 deletions

4
t3x.md
View file

@ -4,7 +4,7 @@
T3X is a family of relatively obscure [minimalist](minimalism.md) [programming languages](programming_language.md) similar to [Pascal](pascal.md), made by Nils M Holm. There are different versions of the language (dating back to the [90s](90s.md)), distinct mainly by "feature richness" and small polishing over the years, but being very similar in general; most notable is probably **T3X/0** (made in 2022), described as a "sweet spot" between minimalism and "practical usability". The code is released under permissive [free software](free_software.md) [licenses](license.md), some even under [CC0](cc0.md), but sadly some of the formal specifications are proprietary and accessible only after payment. The languages are very well implemented, the body of work is a joy to behold and explore -- even though very strictly speaking these languages aren't the absolute peak of minimalism (some even sport some kind of "simplified [OOP](oop.md)") but rather seem like an attempt at remaking an oldschool language in nicest way possible while keeping to some pragmatic and practical choices, still compared to anything [modern](modern.md) they are super minimal; [C](c.md) definitely looks like a pile of [bloat](bloat.md) compared to T3X languages. For more details see the author's website at https://t3x.org/t3x/index.html.
The languages are very cool but their implementation is probably what's even more notable here: T3X/0 is [self hosted](self_hosting.md) in about 4 thousand lines { Doing `wc -l *.t library/*.t`. ~drummyfish }, [bootstrappable](bootstrap.md) and extremely [portable](portability.md) (so far lists e.g. generic [Unix](unix.md), [freeBSD](freebsd.md), [mac](mac.md), [DOS](dos.md), CP/M, 386, [x86](x86.md), [ARM](arm.md)), allowing cross compilation basically on every supported platform to any other etc. This is an example of how software should be written.
The languages are very neat but their implementation is probably yet more worthy of attention here: T3X/0 is [self hosted](self_hosting.md) in about 4 thousand [lines](loc.md) { Doing `wc -l *.t library/*.t`. ~drummyfish }, [bootstrappable](bootstrap.md) and extremely [portable](portability.md) (so far lists e.g. generic [Unix](unix.md), [freeBSD](freebsd.md), [mac](mac.md), [DOS](dos.md), CP/M, 386, [x86](x86.md), [ARM](arm.md)), allowing cross compilation basically on every supported platform to any other etc. This is an example of how software should be written.
The languages evolved from early (1995) experimental languages named `T_1` and `T_2` into a big tree of languages and compilers. The most notable ones are currently probably these:
@ -19,7 +19,7 @@ Worthy of mention is also so called **Tcode**, a [bytecode](bytecode.md) and [vi
The author, Nils M Holm, is a [Buddhist](buddhism.md) (according to his website a "pragmatic" one) minimalist programmer living in Germany, probably of older age (considering he keeps talking about programming in the 80s and was making own languages in the 90s), who has published an impressive number of books (sadly [proprietary](proprietary.md)) on the topic of minimalist programming, compilers, [Lisp](lisp.md) etc., sharing some views with [LRS](lrs.md) (expressing sadness about what computer science has evolved into since the 80s, that "[hackers](hacking.md) turned into entrepreneurs" and so on).
LRS is always very happy to see people strive for simplicity and we applaud the author's passion and incredible effort over several decades whose fruit is now very helpful to the entire world. A few words of criticism could be stated of course, like always, for example that the language seems to go for unnecessary features such as modules or even objects -- there is no need to implement modules that enforce encapsulation and allow dot syntax like for example `t3x.write` if we can achieve the same thing by simply writing a library with prefixed functions, e.g. `t3x_write` (while keeping private members further prefixed with `_`, like `_t3x_internalvariable`). Some syntax elements, like `do ... end` instead of plain curly brackets (which are objectively better) seem to be perhaps a little driven by nostalgia. From ultraminimalist point of view the language is actually quite feature rich, which is fine, but then suddenly some really useful features that would be expected at this level, such as a number printing function, seem to be missing. Some functions and constructs are a little tricky and not self-documenting, for example the for loop just takes 2 arguments and it's not clear what they mean, the upper bound behaves like traditional C for loop, i.e. iterating as long as the variable is BELOW (and NOT equal) to the bound, but whereas in C this is clear by the presence of the `<` operator, here we are left guessing, and one would probably expect `<=` is actually implied { Before looking it up I actually even considered that it may say the NUMBER of iterations. ~drummyfish }. Also the built-in printing function is a bit awkward, first taking file descriptor, then the string, and then the length of the string (which itself is zero terminated). In any case the author will probably keep improving the language as he has been for a long time, so we may very likely expect his work to get more and more polished.
[LRS](lrs.md) is always pleased to see people strive for simplicity and we applaud the author's passion and incredible effort over several decades whose fruit is now very helpful to the entire world. A few words of criticism could be stated of course, like always, for example that the language seems to go for unnecessary features such as modules or even objects -- there is no need to implement modules that enforce encapsulation and allow dot syntax like for example `t3x.write` if we can achieve the same thing by simply writing a library with prefixed functions, e.g. `t3x_write` (while keeping private members further prefixed with `_`, like `_t3x_internalvariable`). Some syntax elements, like `do ... end` instead of plain curly brackets (which are objectively better) seem to be perhaps a little driven by nostalgia. From ultraminimalist point of view the language is actually quite feature rich, which is fine, but then suddenly some really useful features that would be expected at this level, such as a number printing function, seem to be missing. Some functions and constructs are a little tricky and not self-documenting, for example the for loop just takes 2 arguments and it's not clear what they mean, the upper bound behaves like traditional C for loop, i.e. iterating as long as the variable is BELOW (and NOT equal) to the bound, but whereas in C this is clear by the presence of the `<` operator, here we are left guessing, and one would probably expect `<=` is actually implied { Before looking it up I actually even considered that it may say the NUMBER of iterations. ~drummyfish }. Also the built-in printing function is a bit awkward, first taking file descriptor, then the string, and then the length of the string (which itself is zero terminated). In any case the author will probably keep improving the language as he has been for a long time, so we may very likely expect his work to get more and more polished.
## T3X/0: The Language