Things That Turbo Pascal Is Smaller Than (2011)
prog21.dadgum.com
prog21.dadgum.com
A couple years later, I encountered common lisp for the first time; it was even better because you could recompile single functions. To this date, I still think very short iteration time is a super-power for program design.
Hand written assembly was optimised, Pascal is easy to compile language, but there are a lot of other things
- Segmented 16 bit pointers - No graphics or images - Limited OS - no glibc, could only save A: and C: drives - Computers could not hibernate or sleep - Computers did not have periheral devices or needed special software: printer, mouse - No network - No multitasking - No portability
For the editor itself
- No autocomplete - No colours - Not very useful error messages - VI like navigation experience (got much better in 5 years with Turbo Vision IDE framework)
Also
- All documentation was in a dead tree format
For the good reference point on sizes, the bible text is 4-5 MB.
My Thinkpad 300 would like a word with you. It can sleep to RAM and hibernate, done via apm if OS supports it or through keys, but basically everything is done by the BIOS and works fine with DOS.
Anyway I don't think you're quite explaining it (in spite of a good effort and nice points) because, look, the mere hash table module in my TXR language has 30K of machine code. This happens to be 32 bit x86:
$ size opt/hash.o
text data bss dec hex filename
31558 100 8 31666 7bb2 opt/hash.o
It's just a bunch of hash table functions.I cannot say, oh, my hash table functions are almost bigger than Turbo Pascal 3 for MS-DOS because of documentation (there isn't any), autocomplete (none and not applicable) or because I have networking, multitasking (also not applicable).
I mean, Turbo Pascal 3 probably has some internal hash table itself, and provides an entire language and IDE, in the same space as my hash table stuff.
/bin/ls on Debian 11, x86_64:
size /bin/ls
text data bss dec hex filename
131876 4728 4824 141428 22874 /bin/ls
What are the amazing features in ls? It does ANSI color and probably something with extended attributes; so, ooooh! that must be why it's four times bigger than Turbo Pascal 3?In V (https://github.com/vlang/v/) for example, with the currently experimental native backend, you can produce executables, that are < 400 bytes:
$ cat examples/hello_world.v
println('Hello, World!')
$ ./v -b native -o hw examples/hello_world.v
$ ls -l hw
-rwxrwxr-x 1 delian delian 183 Mar 13 17:51 hw
$ ./hw
Hello, World!What bugs me is that even though vast majority of work is now outsourced to OS and external libraries and tremendous advances are made in compilation tech, our generated binary sizes are no where close to hand coded assembly. I mean not even close. For example, hello world manual assembly should take about 142 bytes. However, even assembler will spit out whooping 9KB binary for hello world in assembly language! Hello world in C will cost you a binary size of mind numbing 2000KB. https://drewdevault.com/2020/01/04/Slow.html
So put this perspective.
2MB? I'm not sure where that number comes from. Maybe I misunderstand what you mean. I just tried compiling
#include <stdio.h>
main(){
printf("Hello, world\n");
}
with gcc on a Mac. The binary is 13340 bytes. Surprisingly big, but not 2000000 bytes! 1/150 that size.There were colours. And the library was small and well documented with embedded help files containing examples. So autocomplete was no blocker. Errors were fine as far as I remember. Perhaps you mean turbo c++?
Things That Turbo Pascal Is Smaller Than (2011) - https://news.ycombinator.com/item?id=22843140 - April 2020 (170 comments)
Things That Turbo Pascal Is Smaller Than (2011) - https://news.ycombinator.com/item?id=15104766 - Aug 2017 (15 comments)
Things That Turbo Pascal Is Smaller Than (2011) - https://news.ycombinator.com/item?id=11733610 - May 2016 (2 comments)
Things That Turbo Pascal is Smaller Than (2011) - https://news.ycombinator.com/item?id=4592997 - Sept 2012 (58 comments)
Things That Turbo Pascal is Smaller Than - https://news.ycombinator.com/item?id=3175629 - Oct 2011 (114 comments)
Turbo Pascal was an awesome IDE. I remember writing a lots of DOS software for it. Including a graphical shell (like early Windows).
All of that in PCs running MS-DOS in 1 MB RAM.
Thanks Borland.
It was pretty much how I learned to program, but I can't say I miss the days when the program would crash, then you insert a blank line randomly in the source code and it would work again.
Uh you’re doing fine. You are a complete beast and deeply inspiring.
P.S. At Microsoft I worked with Anders Hejlsberg, who created Turbo Pascal (and C#, typescript, etc.) I took full advantage of my position and peppered him with questions about compiler writing, which he endured with grace and good humor.
The question is even with him can we do that for other software.
My issue is: sure, you can measure it, but does the result even make sense? Like, OK, we can compute how “random” an instruction stream is, but what purpose does it serve?
ISAs aren’t designed in a random manner, so what’s the point in comparing the entropy values of two different programs? The only thing I can think of is determining how compressible a given program is. But, that doesn’t tell us anything about performance/instruction (or byte).[a]
[a] For example, AES-512 can pack massive amounts of functionality into 5 or so bytes