6 ms·
In comparison, you can get TCC (tiny compiler) which is 100KB in size and can produce 32/64 bit code, compile the Linux kernel and probably better optimizations
by pkaye 5y ago
In comparison, you can get TCC (tiny compiler) which is 100KB in size and can produce 32/64 bit code, compile the Linux kernel and probably better optimizations.
https://en.wikipedia.org/wiki/Tiny_C_Compiler https://en.wikipedia.org/wiki/Tiny_C_Compiler
- jart 5y agoTCC is non-optimizing and its 64-bit implementation was contributed by someone else and never finished. Borland Pascal has an IDE. Their executable has 7.141258 bits per byte of entropy. That's even higher than SectorLISP, a 436 byte development environment, which only has 6.300498 bits per byte of entropy. I wish I could travel back in time and the people who wrote Turbo Pascal could probably teach me a thing or two about size optimization tricks.
- tomcam 5y ago> I wish I could travel back in time and the people who wrote Turbo Pascal could probably teach me a thing or two about size optimization tricks. 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.
- ngcc_hk 5y agoAmazing opportunity. That software is just crazily good. The question is even with him can we do that for other software.
- colejohnson66 5y agoHow do you even define “entropy” of a program? It’s a byte stream where each byte is important.
- jart 5y agoShannon entropy. https://github.com/jart/cosmopolitan/blob/master/libc/rand/measureentropy.c https://github.com/jart/cosmopolitan/blob/master/libc/rand/m... You can even measure a program in terms of physics constants too.
- colejohnson66 5y agoNot trying to be rude here; Just trying to understand… 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
- jart 5y agoIt's useful to be able to calculate the density of information. For example, redbean uses it to determine whether or not it's profitable to apply gzip. It has nothing to do with isa. That's kind of the point. For example, I could have written a routine that said, don't bother compressing files with the extension jpeg, jpg, png, gz, zip, etc. or I could have used information theory like I did. Another cool example is I've never seen any code that has higher information density than biology.