Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

seven programming languages on one floppy (Developers)

posted by kerravon, Ligao, Free World North, 03.04.2023, 03:04

> But most people aren't engineers writing their own OSes and compilers, so
> compatibility is important. I'm not saying throw everything away. BUT I'm
> sure it could be much smaller (and use less RAM) without being terminally
> slow. In other words, there's no reason to totally ditch C just to use more
> efficient code generation.
>
> In some ways, the answer is scripting languages (e.g. AWK) that (usually)
> don't generate (byte)code. One interpreter with ten scripts is probably
> smaller than ten compiled binaries. But that's not always feasible because
> of third-party libraries.

I agree with what you say about bloat, but I'm a bit confused about this proposal.

AWK is a different language. If you prefer that language fine, but you have now compared interpretation to compilation.

There are C interpreters. And the Forth thing you quoted said it compiled just in time too I think.

So - what's wrong with either a C interpreter or something that compiles your C program before running it?

Also what's wrong with putting the C library in either the OS or in a DLL like msvcrt.dll? That will produce a small executable too.

If you don't like even a few k for a hello world because of the executable overhead, then even that can be changed with a simpler executable format.

Here is a hello world that runs under PDOS-generic:

C:\devel\pdos\generic>hexdump pcomm.exe
000000 07016400 50000000 00000000 10000000 ..d.P...........
000010 00000000 00000000 20000000 00000000 ........ .......
000020 5589E583 EC148B45 088B5014 C7023000 U......E..P...0.
000030 0000A350 0000006A 00FF10C9 C3909090 ...P...j........
000040 68656C6C 6F2C2077 6F726C64 0A0089F6 hello, world....
000050 5589E583 EC0883E4 F083EC0C 68200000 U...........h ..
000060 00A15000 0000FF50 1031C0C9 C3909090 ..P....P.1......
000070 0E000000 04000004 13000000 08000004 ................
000080 3D000000 04000004 42000000 08000004 =.......B.......

144 bytes.

BFN. Paul.

 

Complete thread:

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