Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Turbo Pascal vs. other compilers/dialects (esp. Wirth-ian) (Announce)

posted by Rugxulo(R) Homepage, Usono, 25.06.2019, 07:31

> > What exactly do you miss that you can't find in existing solutions? I
> > somewhat know what you mean, but then again, we already have dozens of
> > tools (of varying quality). TP is good and unique but not that
> > unique or irreplaceable!
>
> That's easy:
> 1) TP6+ compatible (inline assembler),
> 2) Self-hosting,
> 3) Less than 1 Mbyte,
> 4) FOSS.
>
> All in one product!

I definitely sympathize, obviously, but I think nostalgia is less crucial than something you can actively use. From an architectural standpoint, considering how the BIOS/CSM is going away for good, how IA-32 is basically dead (see latest Ubuntu news, among others), how AMD64 hates 16-bit code, you'll be stuck to a VM, which sometimes won't work as well as you'd like. Hey, I like 8086 and DOS, but perhaps sticking to that exclusively for the future isn't wise.

MarcoV would clearly say "Just use FPC, it's more portable, more architectures, not limited only to mode TP, and (since it's FOSS and self-hosted) can be slimmed/modified if needed." You might even be able to compress it (with various tools) if 1 MB was truly your goal (for whatever unknown reason). But you knew that.

Dialectically speaking, there's a lot of similar toolsets. For classic Pascal (ISO 7185), you have P5 and p5c. GPC is effectively inactive, so there aren't many other Extended Pascal (ISO 10206) options, but sources are still available. I think Pat Terry long ago ported Hans-Peter Mossenbock's Coco/R parser to Turbo Pascal.

Wirth added SYSTEM to Modula-2, so inline assembly wasn't needed as badly. He prefers Oberon since forever anyways. I think he went out of his way to avoid literally any assembly in his latest works, relegating the minor need for system-specific stuff to the SYSTEM pseudo-module. His preferred dialect is Oberon-07, and his Compiler Construction and Project Oberon online projects/ebooks (BSD-licensed) are self-hosted and fit in 1 MB (of RAM) on a Xilinx Spartan FPGA or whatever. Not quite what you wanted but somewhat similar. (I think GForth had a Gray parser for Oberon, too.)

Turbo Pascal borrowed a lot of stuff from Modula-2 anyways (units vs. modules, close enough), maybe even from Oberon. (The OOP stuff is called "type extension" in Oberon.) Compared to raw assembly (and we have many self-hosted assemblers), Pascal is probably easier for units, strings, and dynamic heap allocation but otherwise not groundbreaking. I think Mossenboch's Oberon-2 book is freeware nowadays, not to mention Wirth's PIO (Programming in Oberon) instead of older (famous) PIM[234]. Although there are many Oberon dialects (Component Pascal [sic], Active Oberon, Zonnon).

Oh, even Excelsior XDS Modula-2/Oberon-2 compiler (which officially is supported by Japheth's HX) has now been open-sourced (Apache 2.0)! Although I'm still wondering if GM2 will ever be upstreamed (probably!) or work with DJGPP. (Bah, we still need some work towards FPC's Go32v2 and i8086-msdos.)

I know none of this is a quick fix or perfect solution, but similar things do exist and are out there in the wild. It wouldn't be impossible to recreate TP (or similar language or functionality) for DOS. Even MarcoV I think normally used to prefer Modula-2 over TP, but nowadays he's all in for Delphi (which is quite advanced, albeit very complicated after 20+ years). Even XPL0 was loosely based upon Wirth's old Pascal-based PL/0 (from A+D=P).

Sorry for the ramble. I just don't know why it's so hard to make a useful, simple, portable, standard compiler (that is easy to rebuild!).

 

Complete thread:

Back to the forum
Board view  Mix view
15974 Postings in 1478 Threads, 271 registered users, 46 users online (0 registered, 46 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum