Live data from Hacker News

Tiniest x86-64-Linux emulator

github.com

11–20 of 27 posts

Re: Tiniest x86-64-Linux emulator

#13
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)

Definitely more numerate. https://en.wikipedia.org/wiki/Bellard%27s_formula

Re: Tiniest x86-64-Linux emulator

#14

Earlier quoted context omitted.

You can use it to configure the build mode: `build/bootstrap/make.com -j8 MODE=rel o/rel/blink/blink`; no MODE will build a default config. This is used across all cosmopolitan projects; for example, this is for redbean: https://redbean.dev/#source .

I'm not following. Is o//blink/blink different from o/blink/blink ?

The MODE variable in the Makefile is undefined by default so "o/$(MODE)/" becomes "o//"

Re: Tiniest x86-64-Linux emulator

#15

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…

[deleted]

Re: Tiniest x86-64-Linux emulator

#16
> It'll be nice to know that any normal PC program we write will "just work" on Raspberry Pi and Apple ARM. All we have to do embed an ARM build of the emulator above within our x86 executables, and have them morph and re-exec appropriately, similar to how Cosmopolitan is already doing doing with qemu-x86_64, except that this wouldn't need to be installed beforehand. The tradeoff is that, if we do this, binaries will only be 10x smaller than Go's Hello World, instead of 100x smaller.

…No mention of the fact that an interpreter is typically at least 10x slower than native execution. The readme does say "we're still likely to add something like jit in the near future", but for now this isn't very practical.

Re: Tiniest x86-64-Linux emulator

#17

That's beautifully worked. o//blink/blink What's the double slash for?

There are specific comments already, but multiple successive slashes are treated as a single slash, in every case except when a path begins with exactly two slashes, in which case it's implementation dependent.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1...

Re: Tiniest x86-64-Linux emulator

#18
post #16

> It'll be nice to know that any normal PC program we write will "just work" on Raspberry Pi and Apple ARM. All we have to do embed an ARM build of the emulator above within our x86 executables, and have them morph and re-exec appropriately, similar to how Cosmopolitan is already doing doing with qemu-x86_64, except that this wouldn't need to be installed beforehand. The tradeoff is that, if we do this, binaries will…

Presumably apps which spend most of their time in system calls will not be noticeable slower.

Re: Tiniest x86-64-Linux emulator

#19
post #16

> It'll be nice to know that any normal PC program we write will "just work" on Raspberry Pi and Apple ARM. All we have to do embed an ARM build of the emulator above within our x86 executables, and have them morph and re-exec appropriately, similar to how Cosmopolitan is already doing doing with qemu-x86_64, except that this wouldn't need to be installed beforehand. The tradeoff is that, if we do this, binaries will…

Presumably apps which spend most of their time in system calls will not be noticeable slower.

[deleted]

Re: Tiniest x86-64-Linux emulator

#20
post #16

> It'll be nice to know that any normal PC program we write will "just work" on Raspberry Pi and Apple ARM. All we have to do embed an ARM build of the emulator above within our x86 executables, and have them morph and re-exec appropriately, similar to how Cosmopolitan is already doing doing with qemu-x86_64, except that this wouldn't need to be installed beforehand. The tradeoff is that, if we do this, binaries will…

Petty remark, comex.

Their pitch is "tiniest".

Post reply on HN