> One of the projects currently using Blink is Cosmopolitan Libc. Blink is more embeddable than qemu-x86_64 since Blink is 22x tinier in terms of binary footprint. So what Cosmo does is it vendors prebuilt Blink binaries inside each of the x86-64 executables it compiles. That way, whenever someone tries to run these programs on a different architecture like Arm, the Actually Portable Executable shell script wrapper will simple extract the appropriate blink binary and re-run itself.
Cosmopolitan LibC is truly “write once run anywhere” except instead of using JVM virtualization, it used x86_64 as the portable VM. Your users don’t need to install a VM or runtime, and you can ship a single exe that runs on all popular architectures and operating systems, including bare metal.
master jart@nightmare:~/cosmo$ blink ruby --yjit -e 'printf("%d\n",2+2)'
<main>: warning: timer_create failed: Function not implemented, signals racy
4
master jart@nightmare:~/cosmo$ cat blink.log
I2023-06-05T04:22:15.525179:blink/syscall.c:1020:29575 unsupported prctl op 0x29
I2023-06-05T04:22:15.556803:blink/syscall.c:5720:29575 missing syscall 0x122
I2023-06-05T04:22:15.556866:blink/syscall.c:5720:29575 missing syscall 0x122
I2023-06-05T04:22:15.556886:blink/syscall.c:5720:29575 missing syscall 0x0de
You can also use `blink -es program...` to log system calls to stderr, similar to strace, when you need to troubleshoot further. Once you do that, please file a feature request.The most important post-SSE2 extensions are SSSE3 (pshufb) and SSE4.1 (rounding, min/max, blending, etc...). Pure SSE2 is a nightmare to use as it's a totally unbalanced SIMD ISA (a lot of missing stuff here are there requires a lot of workarounds and sometimes it's just better to go scalar). In addition, just [V]PSHUFB alone can do wonders and has a lot of application - I would say that almost all interesting problems can take the advantage of PSHUFB.
Instructions can be comfortably explored here: