T3X/0 一种极简过程式语言
T3X/0 a Minimal Procedural Language

原始链接: https://t3x.org/t3x/0/index.html

T3X/0 是一种紧凑、便携且几乎无类型的过程式编程语言,其灵感源自 Pascal 语法和 BCPL 语义。它专为简洁和高效而设计,主要作为多本编译器和软件设计书籍中的教学工具。 T3X/0 生态系统具备显著的自托管和跨平台特性,支持从现代类 Unix 系统(包括 ARM 和 x86_64)到 DOS 和 CP/M 等复古计算平台的广泛环境。该语言软件包包含编译器源码、运行时库以及两个轻量级集成开发环境(VI 和兼容 WordStar 的编辑器),即使在旧式系统上也能实现无缝编译和错误导航。 T3X/0 在 0BSD/公有领域许可下发布,以紧凑的软件包形式分发,内含预编译二进制文件、文档及各种示例程序。通过使用 Tcode 虚拟机(TCVM),它能够为 16 位架构提供强大的交叉编译能力,使其成为现代开发和历史计算爱好者皆可使用的多功能工具。

抱歉。
相关文章

原文
T3X.ORG t3x/0/index
T3X/0 Logo

[ Download | Book | Reference ]

T3X/0 is a small, portable, procedural, block-structured, recursive, and almost typeless programming language, and the latest member of the T3X family of languages. Its compiler is freely available (0BSD license or public domain). T3X/0 syntax is similar to Pascal, its semantics resembles BCPL's. Here is a T3X/0 language cheat sheet (PDF).

NOE editor screenshot

The T3X/0 package provides two editors (one VI-compatible, one WordStar-compatible) with built-in compiler support. Compile your programs by literally pressing three keys. In case of an error the editors jump to the error. This works even on CP/M!

T3X/0 is used as a teaching language in the books

Write Your Own Retro Compiler and
Write Your Own Programs

It is formally defined in the book The T3X Programming Language - Formal Definition.

Here is the simplest "Hello World" program in T3X/0:

USE t3x: t;
DO t.write(T3X.SYSOUT, "Hello, World!\r\n", 15); END

(Of course this program cuts some corners, so here are some more correct versions.)

Here are some more interesting programs written in T3X/0:

Simple Examples
More (or Less) Serious Programs

If you want to learn more about the T3X/0 language, here is

A Very Short T3X/0 Summary
The T3X/0 Language Reference
A T3X/0 online compiler

T3X/0 currently runs on

  • Unix (386, x86_64, ARMv6, ARMv7)
  • FreeBSD-386 (static code backend, LIBC not needed)
  • macOS-686
  • {PC,MS,DR,etc}-DOS 2.0 and later
  • CP/M 2.2 (Z80 only)
  • The TCVM (Tcode Virtual Machine)

It is self-hosting on all supported platforms and can cross-compile to all supported 16-bit platforms.

More details on supported systems
Some compiler statistics

Download the Compiler

t3x0-47.zip (current version, ~350KB)
This is the full source code to the compiler (in T3X/0) and the runtime libraries (in Z80, 8086, and 386 assembly language, and in C). The archive also contains an implementation of the Tcode Virtual Machine in C, a TCVM binary for DOS, additional libraries, example programs, two editors with built-in compiler support ("IDEs"), documentation, and pre-compiled compiler binaries for CP/M, DOS, FreeBSD, and the Tcode machine. What's new since the book version?
t3x0-12.zip (book version, ~200KB)
This is the same as above, but the version frozen at the time when the book was published.
t3x0dos.zip (DOS binaries, ~100KB)
A pre-compiled T3X/0 compiler for DOS, including all libraries in DOS text format, the T3X/0 Reference Manual, example programs, the NOE and VEE editors (including their source code), and a configuration utility for patching the compiler so that it can be installed in a directory of your choice.
t3x0cpm.zip (CP/M binaries, ~310KB)
A pre-compiled T3X/0 compiler for CP/M, including all libraries in CP/M text format, the T3X/0 Reference Manual, example programs, the NOE and VEE editors (including their source code), and a utility for patching the compiler so that it can be installed on a disk drive of your choice.
Warning: ZIP file extracts into the working directory, because CP/M has no directories. The ZIP file is uncompressed, so it should extract under CP/M.
t3x0agon.zip (CP/M disk image for the Agon Light 2, ~110KB)
An 8MB CP/M hard disk image containing all files of t3x0cpm.zip, above. Intended to be installed on an Agon Light 2 computer running CP/M.

联系我们 contact @ memedata.com