Commit Graph

64 Commits (main)

Author SHA1 Message Date
Justine Tunney 4918121810 Add new calculator app
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
2020-06-30 19:58:08 -07:00
Justine Tunney ac00be1a4e Make small fixes and oops ran clang-format on dtoa 2020-06-30 19:55:47 -07:00
Justine Tunney b5b60015f5 Add spellcheck example
One of the benefits of implementing system call support from scratch is
that we're able to have embedded zip filesystem support which trickles
into libraries such as stdio, without unportable symbolic interposition.
It's also be great if we could say open("gs://bucket/object", O_RDONLY)
for seamless GCS, similar to Java NIO, but abstracted by the C library.
2020-06-27 12:25:40 -07:00
Justine Tunney 0ad0408ac6 Fix stdio bug w/ embedded zip filesystem 2020-06-27 11:48:29 -07:00
Justine Tunney d5c3a6f039 Add example for auto debugging and asm() usage 2020-06-26 16:09:04 -07:00
Justine Tunney d51409ccd9 Add glob and some finer tuning of documentation 2020-06-21 15:23:35 -07:00
Justine Tunney 799e24a87b Reduce build log verbosity with preprocessor trick 2020-06-18 23:07:58 -07:00
Justine Tunney a2c2d14100 Add further clarity to example package 2020-06-18 16:23:41 -07:00
Justine Tunney d2b20422c8 Add about section to readme 2020-06-16 16:58:35 -07:00
Justine Tunney b1755cea5d Darth Raadt is holding the Bell Labs ABI hostage
The binary system interfaces designed at Bell Labs were what helped our
friends like Linus Torvalds become successful. It's why Torvalds always
respected syscall abi and made every effort to not break the userspace.

Sadly OpenBSD developer Theo de Raadt thinks respecting Bell interfaces
is a risk for security and conjured up the Return Oriented Programming
bogeyman to justify his policies, per https://lwn.net/Articles/806776/

See libc/nexgen32e/gc.S where we use ROP concepts for garbage collection
in C due to our belief that powerful programming techniques can be good.
See https://opensource.googleblog.com/2017/03/operation-rosehub.html for
an example of something similar to rop but potentially more of a concern
2020-06-16 06:41:10 -07:00
Justine Tunney 2e979c00c3 Polish up repository and other revisions 2020-06-16 06:38:43 -07:00
Justine Tunney d23bb6612e Make it easy to create new packages 2020-06-15 22:09:03 -07:00
Justine Tunney b4269930f7 Add scouts honor escape hatch for source embedding 2020-06-15 19:01:28 -07:00
Justine Tunney c91b3c5006 Initial import 2020-06-15 07:18:57 -07:00