jart/cosmopolitan
View on GitHub ↗ ★ 21,431 C
build-once run-anywhere c library
293 mentions on Hacker News by 135 people: 24 stories, 269 comments · first 2020-06-20 · latest 2026-10-11
20082026
-
Real link: https://github.com/jart/cosmopolitan/releases/tag/3.1
comment by bmacho · 2023-11-20 · in Cosmopolitan v3.1 -
▲ 9
Release Cosmopolitan v3.1story by ofou · 2023-11-19 · 3 comments
-
…the same binary will run on windows, linux, mac, and BIOS. /s This has been done with Lua, see: https://github.com/jart/cosmopolitan/issues/61
comment by jakobson14 · 2023-11-06 · in A standalone zero-dependency Lisp for Linux -
Good news: https://github.com/jart/cosmopolitan/commit/5e8c928f1a37349a...
comment by dylukes · 2023-11-04 · in Cosmopolitan Third Edition -
Pull request sent. https://github.com/jart/cosmopolitan/pull/924 Oops, I only now realized there's a test suite. I'll be adding tests too... After I get some sleep.
comment by matheusmoreira · 2023-11-02 · in Cosmopolitan Third Edition -
See the comments in https://justine.lol/ape.patch and at the bottom of https://github.com/jart/cosmopolitan/blob/3.0/tool/build/ape... and also https://github.com/jart/cosmopolitan/blob/3.0/ape/loader.c has good information too. I'm…
comment by jart · 2023-11-02 · in Cosmopolitan Third Edition -
Cool. Somebody still needs to teach sscanf how to parse floats though. https://github.com/jart/cosmopolitan/issues/456 The code to do it would probably go in here: https://github.com/jart/cosmopolitan/blob/master/libc/stdio/... I mean, I…
comment by smcameron · 2023-11-02 · in Cosmopolitan Third Edition -
Author here. We've got you covered. Search for `MODE=tinylinux` in the https://github.com/jart/cosmopolitan#getting-started section of the README. If you use that build mode, then hello world for x86 linux is only 8kb in size. It's very…
comment by jart · 2023-11-01 · in Cosmopolitan Third Edition -
Discuss here: https://github.com/jart/cosmopolitan/discussions Add issues here: https://github.com/jart/cosmopolitan/issues
comment by AMICABoard · 2023-11-01 · in Cosmopolitan Third Edition -
Yes they do! https://github.com/jart/cosmopolitan/tree/master/third_party... and https://github.com/trholding/llama2.c
comment by AMICABoard · 2023-11-01 · in Cosmopolitan Third Edition -
There's so much cool stuff in this post. https://github.com/jart/cosmopolitan/releases/download/3.0.1... is 213MB file which contains "fat binaries" (single binaries that execute on a bewildering array of hardware platforms and operating…
comment by simonw · 2023-11-01 · in Cosmopolitan Third Edition -
…can even go above and beyond with cosmopolitan libc v2, which makes c/c++ build-once run-anywhere: https://github.com/jart/cosmopolitan/releases/tag/2.0 There seems to be some work getting cosmopolitan libc support in Go, but it is not…
comment by mathiasgredal · 2023-09-17 · in Java 21 makes me like Java again -
…means you can write a simpler algorithm than what Lemire did that assumes an ASCII average case. https://github.com/jart/cosmopolitan/blob/755ae64e73ef5ef7d1... That goes 23 GB/s on my machine using just SSE2 (rather than AVX512). However…
comment by jart · 2023-08-21 · in Transcoding Latin 1 strings to UTF-8 strings at 12 GB/s using AVX-512 -
…old fashioned way. The recent version of cosmopolitan generates ARM binaries for Linux and MacOS ( https://github.com/jart/cosmopolitan#arm; mode aarch64). There is also blink that provides the x86-64 emulation layer for (APE and other)…
comment by paulclinger · 2023-07-14 · in Patching GCC to build Actually Portable Executables -
…convert to/from the old constants during runtime is too much. Look at the list of constants here: https://github.com/jart/cosmopolitan/blob/master/libc/sysv/c... Every time I used any of these constants, I'd have to load a whole bunch of…
comment by ahgamut · 2023-07-14 · in Patching GCC to build Actually Portable Executables -
There seems to be a standard socket API in the Cosmopolitan clib though: https://github.com/jart/cosmopolitan/tree/master/libc/sock ..and that also seems to have WinSock support: https://github.com/jart/cosmopolitan/blob/master/libc/sock/c.…
comment by flohofwoe · 2023-07-14 · in Patching GCC to build Actually Portable Executables -
…to inject a SECCOMP filter. Then you can block execve(). See https://justine.lol/pledge/ and https://github.com/jart/cosmopolitan/blob/master/tool/build/...
comment by jart · 2023-07-07 · in List of Unix binaries that can be used to bypass local security restrictions -
…you pass a pipe into the whole (server) process, instead of having it open its own sockets? (In https://github.com/jart/cosmopolitan/blob/48b2afb192ec18eca4... , I gather?) I haven't followed cosmopolitan / Linux pledge() too closely; but…
comment by JoachimSchipper · 2023-06-19 · in Redbean Systems -
See https://github.com/jart/cosmopolitan/commit/48b2afb192ec18ec... and https://twitter.com/JustineTunney/status/1670600564164657154
comment by jart · 2023-06-19 · in Redbean Systems -
…datagrams so it can blackhole your IP address in the RAW PREROUTING iptable if you DDOS the system. https://github.com/jart/cosmopolitan/blob/f10845ab9f847e4cad... You can't ban someone's IP without root. So we have two choices: (1) create…
comment by jart · 2023-06-18 · in Redbean Systems -
I'd love to understand more about what the ".verynice()" call does. Source is here: https://github.com/jart/cosmopolitan/blob/f10845ab9f847e4cad... What are the effects of limiting a process priority?
comment by maxmcd · 2023-06-18 · in Redbean Systems -
…which maintains support for old file formats. You can build and use it as follows: git clone https://github.com/jart/cosmopolitan cd cosmopolitan # cross-compile on x86-64-linux for x86-64 linux+windows+macos+freebsd+openbsd+netbsd make…
comment by jart · 2023-06-06 · in GGML – AI at the Edge -
I bet it wouldn't be too extremely hard to port Vim to https://github.com/jart/cosmopolitan and run it without an OS (BIOS mode in cosmopolitan).
comment by etaioinshrdlu · 2023-04-22 · in Boot to Vim, Vim as Pid 1 (2014) -
Cosmopolitan[0] is indeed worth mentioning here. It's an amazing project. [0] https://github.com/jart/cosmopolitan
comment by loupol · 2023-02-12 · in How to create portable Linux binaries -
…Worth noting that we do have Google's outstanding double-conversion library in the cosmo codebase https://github.com/jart/cosmopolitan/tree/master/third_party... as well as gdtoa (which is what we use for printf's floating point support)…
comment by jart · 2023-02-03 · in Blink virtual machine now supports running GUI programs -
…appear to be. The comments in the code say it can do floats, but the comments are mistaken.) [1] https://github.com/jart/cosmopolitan/blob/master/libc/fmt/vc... [2] https://github.com/jart/cosmopolitan/issues/456
comment by smcameron · 2023-02-03 · in Blink virtual machine now supports running GUI programs -
…(a 'minimal vfprintf()') with the one in cosmopolitan starting at https://github.com/jart/cosmopolitan/blob/master/libc/stdio/... . Right away we can see nolibc places many functions in the same file while Cosmopolitan uses
comment by eesmith · 2023-01-22 · in Nolibc: A minimal C-library replacement shipped with the kernel -
…I recommend obtaining Python from the Comsopolitan mono repo: git clone https://github.com/jart/cosmopolitan make -j8 o//third_party/python/python.com That'll easily give you a static Python 3.6 binary that can be run under Blink.
comment by jart · 2023-01-06 · in Emulating an emulator inside itself. Meet Blink -
…really nice `cosmocc` toolchain that makes building POSIX software with Cosmo easier than ever. See https://github.com/jart/cosmopolitan/blob/master/tool/script... and https://github.com/jart/cosmopolitan/blob/master/tool/script...
comment by jart · 2023-01-04 · in Emulating an emulator inside itself. Meet Blink -
…I wrote in C (with a focus on readability) which runs https://ipv4.games/ You can read the code at https://github.com/jart/cosmopolitan/blob/master/net/turfwar... This web server runs on a single VM. It was handling about 300 write…
comment by jart · 2022-12-18 · in Ask HN: Resources for Building a Webserver in C? -
Cosmopolitan Libc uses a musl-cross-make toolchain. https://github.com/jart/cosmopolitan/tree/master/third_party... Its primary developer also runs Alpine. Cosmopolitan is closely related to Musl as far as C libraries go. You could think…
comment by jart · 2022-12-15 · in Actually Portable Perl -
Another example: https://github.com/jart/cosmopolitan/issues/426
comment by comex · 2022-11-10 · in Why is Rosetta 2 fast? -
But python is also universal? You can just bundle jc inside https://github.com/jart/cosmopolitan/tree/master/third_party... and it's as universal as it gets.
comment by ElectricalUnion · 2022-11-03 · in JC – JSONifies the output of many CLI tools -
…rejoice. But it gets better. If you build Python in the Cosmopolitan Libc repository: git clone https://github.com/jart/cosmopolitan cd cosmopolitan build/bootstrap/make.com -j8 o//third_party/python/python.com Then you can use…
comment by jart · 2022-11-03 · in Dozens of malicious PyPI packages discovered targeting developers -
Actually Portable Executables / Cosmopolitan https://justine.lol/ape.html https://github.com/jart/cosmopolitan
comment by smcameron · 2022-10-31 · in Ask HN: What piece of code/codebase blew your mind when you saw it? -
Oh yes. A good place to start would be our c++ toolchain. https://github.com/jart/cosmopolitan/blob/master/tool/script...
comment by jart · 2022-10-24 · in Debugging C with Cosmopolitan Libc -
…our system call support. Look here, all we need to support a XNU system call is 16-bits of a word. https://github.com/jart/cosmopolitan/blob/2.1/libc/sysv/sysc...
comment by jart · 2022-09-21 · in Can I use a system call? -
Love your naming of the magic numbers headers. https://github.com/jart/cosmopolitan/blob/1.0/libc/sysv/cons...
comment by davedx · 2022-09-21 · in Can I use a system call? -
▲ 6
Cosmopolitan v2.1story by jart · 2022-09-20 · 0 comments
-
…to work here) Sadly, it was considered, and XFF is ignored from non-private source addresses: https://github.com/jart/cosmopolitan/blob/155b378a3962e4d291... With private addresses defined as: https://github.com/jart/cosmopolitan/blob/7ab15…
comment by progval · 2022-09-11 · in IPv4 Turf War -
…anything other than educational purposes, at least not until they've been more battle tested. [0]: https://github.com/jart/cosmopolitan/issues/72
comment by coder543 · 2022-09-08 · in Caddyhttp: Enable HTTP/3 by Default -
▲ 5
Cosmopolitan Supports Cross Platform GUI Sort Of. Good Progress so far.story by AMICABoard · 2022-09-06 · 0 comments
-
https://github.com/jart/cosmopolitan/issues/140 https://github.com/golang/go/issues/51900 & from what I gather, APE is tightly-bound to x86_64, & depends on an embedded emulator for other architectures: > All we have to do embed an ARM…
comment by georgia_peach · 2022-08-30 · in How fat does a fat binary need to be? (2021) -
https://github.com/jart/cosmopolitan/blob/master/ape/ape.S https://github.com/jart/cosmopolitan/blob/master/libc/sysv/s... https://github.com/jart/cosmopolitan/blob/master/libc/sysv/s... We do everything static. Even on Apple x86 and M1.
comment by jart · 2022-08-23 · in A general overview of what happens before main() (2019) -
…to define kernel syscalls like how Cosmopolitan [0] uses for building things like RedBean [1]. 0. https://github.com/jart/cosmopolitan 1. https://redbean.dev/
comment by adolph · 2022-08-23 · in A general overview of what happens before main() (2019) -
Don't forget the linker script: https://github.com/jart/cosmopolitan/blob/master/ape/ape.lds It has a longform explanation in the comment at the top.
comment by jart · 2022-08-20 · in Cosmopolitan Libc v2.0 -
…you're looking for a write-up/blog, however, if you haven't peeked at ape.S you absolutely must: https://github.com/jart/cosmopolitan/blob/master/ape/ape.S It is very commented, in a good way.
comment by grimgrin · 2022-08-20 · in Cosmopolitan Libc v2.0 -
▲ 210
Cosmopolitan Libc v2.0story by Orochikaku · 2022-08-20 · 34 comments
-
▲ 9
Cosmopolitan v2.0 – build-once run-anywhere C librarystory by 3np · 2022-08-19 · 0 comments
-
…at the moment. However we'd be happy to see them be included. Most of our modules e.g. unix https://github.com/jart/cosmopolitan/blob/master/third_party... only really depend on Lua and POSIX which is available everywhere. You can build…
comment by jart · 2022-08-17 · in Redbean web server debugging with ZeroBrane Studio