Live data from Hacker News

Tiniest x86-64-Linux emulator

github.com

21–27 of 27 posts

Re: Tiniest x86-64-Linux emulator

#21

They also made cosmopolitan libc [0] which outputs a single binary that runs on many platforms. > The above command fixes GCC so it outputs portable binaries that will run on every Linux distro in addition to Mac OS X, Windows NT, FreeBSD, OpenBSD, and NetBSD too. Your program will also boot on bare metal too. In other words, you've written a normal textbook C program, and thanks to Cosmopolitan's low-level linker ma…

Can you build cross platform libs? So like say you have python or java that calls out to some native code (ex: high performance math routines), but that native code is actually "cosmopolitan"/crossplatform?

Re: Tiniest x86-64-Linux emulator

#22
post #11
post #10

Earlier quoted context omitted.

the only person that can compete with Fabrice Bellard

Fabrice is on a higher level (mainly by virtue of being older, possibly more numerate)

And "lower", too. He even created DVB-T signals from the monitor refresh frequency by tuning X11's specs.

Re: Tiniest x86-64-Linux emulator

#23
post #21

They also made cosmopolitan libc [0] which outputs a single binary that runs on many platforms. > The above command fixes GCC so it outputs portable binaries that will run on every Linux distro in addition to Mac OS X, Windows NT, FreeBSD, OpenBSD, and NetBSD too. Your program will also boot on bare metal too. In other words, you've written a normal textbook C program, and thanks to Cosmopolitan's low-level linker ma…

Can you build cross platform libs? So like say you have python or java that calls out to some native code (ex: high performance math routines), but that native code is actually "cosmopolitan"/crossplatform?

Why not? The difference between an executable and a dynamic library is that an executable has one entry point but a dynamic library can have more than one.

Re: Tiniest x86-64-Linux emulator

#24
This project is interesting, but I looked at tests folder and there is not many tests despite software is so complex. Also I wonder, isn't it better to write tests in languages like Python?

Also, I don't see what's the use of Cosmopolitan Libc. In what situation does one need a CLI-only binary that can run on any system?

Re: Tiniest x86-64-Linux emulator

#25

This project is interesting, but I looked at tests folder and there is not many tests despite software is so complex. Also I wonder, isn't it better to write tests in languages like Python? Also, I don't see what's the use of Cosmopolitan Libc. In what situation does one need a CLI-only binary that can run on any system?

Having a copy of Perl, for example (https://computoid.com/APPerl/), on a USB stick means one could run scripts using the same version of Perl across multiple platforms, no need to wrestle with outdated instances.

Also, it's an awesome hack! C'mon, man, this is Hacker News!

Re: Tiniest x86-64-Linux emulator

#26

This project is interesting, but I looked at tests folder and there is not many tests despite software is so complex. Also I wonder, isn't it better to write tests in languages like Python? Also, I don't see what's the use of Cosmopolitan Libc. In what situation does one need a CLI-only binary that can run on any system?

Author here. Right now it's being tested by running precompiled binaries. See https://github.com/jart/blink/tree/master/third_party/cosmo Most of these test binaries are sourced from the cosmopolitan repository, and many of those come from other projects like nsync, mbedtls, etc. I've recently started working on a unit testing method that's written in plain assembly, to hopefully catch more of the things that would show up in opcodes that compilers don't generate. See https://github.com/jart/blink/tree/master/test/asm
Post reply on HN