mistivia
No, the acos() call is not expensive at all. There is hardware acceleration.We can calculate acos() with in 12 CPU instructions.
https://git.musl-libc.org/cgit/musl/tree/src/math/i386/acos....
If you have really done physics or engineering, you would never believe this. Simple and elegant formulas usually can only solve the "spherical chicken in a perfect vacuum" kind of problems. The real world is incredibly messy. Beneath those clean and beautiful-looking partial differential equations lies a mathematical nightmare. And these equations often only hold at certain scales or rely on extremely strict boundary conditions.
On the other hand, C++ template metaprogramming, as an esolang, is fun to tame and experiment with.
Show HN: Mvvmm – Firecracker-like mini virtual machine monitor in ~2000 LoC
Write a Virtual Machine Monitor and Boot Linux
Show HN: A small embeddable and hackable Lisp-2 interpreter in C
Although it's a toy not for production, it's very interesting that the idea of traits/concept/typeclass just "emerge" out of the code, which made me suddenly understand why STL come into being.
Show HN: EZLive – lightweight serverless self-hosted livestream
https://github.com/mistivia/ezlive
I recently made a small open source project `EZLive`. It lets you host your private live video without a server with public IP address. It can also serve as a build block of a more complex media system.EZLive will create a localhost RTMP ingest server, allowing OBS to stream video. Then EZLive converts the video into HLS files (.m3u8 + .ts). HLS files are uploaded to S3-compatible storage (like...