This change includes many bug fixes, for the NT polyfills, strings,
memory, boot, and math libraries which were discovered by adding more
tools for recreational programming, such as PC emulation. Lemon has also
been vendored because it works so well at parsing languages.
- Emulator can now test the αcτµαlly pδrταblε εxεcµταblε bootloader
- Whipped up a webserver named redbean. It services 150k requests per
second on a single core. Bundling assets inside zip enables extremely
fast serving for two reasons. The first is that zip central directory
lookups go faster than stat() system calls. The second is that both
zip and gzip content-encoding use DEFLATE, therefore, compressed
responses can be served via the sendfile() system call which does an
in-kernel copy directly from the zip executable structure. Also note
that red bean zip executables can be deployed easily to all platforms,
since these native executables work on Linux, Mac, BSD, and Windows.
- Address sanitizer now works very well
This is a recently introduced Linux Kernel feature that gives people
like Debian package mantainers the power to arbitrarily redefine how
executables are interpreted by the kernel. If your system gets tuned
this way and you're not able to disable it, then you need to restore
default behavior for the APE MZqFpD prefix as follows:
sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"
This prefix will cover all .com executables built with this tooling.
Please don't run the above command unless you're certain you need it.
See #2 for additional context.
I wanted a tiny scriptable meltdown proof way to run userspace programs
and visualize how program execution impacts memory. It helps to explain
how things like Actually Portable Executable works. It can show you how
the GCC generated code is going about manipulating matrices and more. I
didn't feel fully comfortable with Qemu and Bochs because I'm not smart
enough to understand them. I wanted something like gVisor but with much
stronger levels of assurances. I wanted a single binary that'll run, on
all major operating systems with an embedded GPL barrier ZIP filesystem
that is tiny enough to transpile to JavaScript and run in browsers too.
https://justine.storage.googleapis.com/emulator625.mp4
Cosmopolitan makes it easy to build and maintain programming languages,
since it abstracts system call #ifdef toil, so you can focus on vision.
Here's an example of a language that isn't turing complete, weighing in
at <1,000 lines of modern C, intended to help with testing libc / libm:
.1 .2 + .3 - abs epsilon < assert
pi sqrt pi sqrt * pi - abs epsilon < assert
-.5 rint dup 0 = assert signbit assert
-.5 nearbyint dup 0 = assert signbit assert
-.5 ceil dup 0 = assert signbit assert
-.5 trunc dup 0 = assert signbit assert
-.5 round -1 = assert
-.5 floor -1 = assert
0 signbit ! assert
CALCULATOR.COM pays homage to CALC.EXE recently removed from Windows 10.
Microsoft should bundle this app instead. It too is roughly 100kb, works
just fine w/ command prompt, and portable since it runs on Mac/Linux/BSD
too while bundling even more features than the calculator on Google.com.
It should be possible to run CALCULATOR.COM on Android and iOS too, just
in case anyone needs a backend pipe driven framework, for graphical user
interfaces of calculators. Sadly we haven't tried it since we don't know
how to run software on telephones so the system call support is a priori