spacedcowboy
5 hours ago
Lots of things from looking up legal docs in non-legalese, through movable roof design for an observatory, through modelling a garage with an a-frame roof, so I can walk in the second floor without ducking, through … the list goes on.
I think the longest running project has to be “my” heterogenous auto-vectorising compiler language though. Been working on this for ~6 months now, pretty much solidly.
It’ll take serially designed code, find areas for vectorisation, and write all of {single-thread CPU, multi-threaded CPU, SIMD, GPU(s) (SPIR-V, MSL, PTX, WGSL) and special hardware (eg SME)}, then at runtime bind the fastest for the machine the binary is running on, measuring to decide, and caching the measurement. Currently I’m working on letting it spread across networked machines (with installed daemons) as well.
It can take naive serial code and produce a binary that will automatically spread it over the optimal execution style for your environment. It compiles for {mac, windows, Linux, iOS, Android, WASM, others}, and every compiler can cross-compile to every target. It can also sign binaries, and doesn’t require any native-platform tools. Oh, and it’s generally faster than GCC and clang or Swift, apart from x86_64/gnu c++ which is 1.05x the speed of xc - these are across a selection of 19 simple non-parallelising (to make it fair) benchmarks, with a geometric mean. Unless you’re multiplying matrices: xc blows everything away then, x86/gcc c++ is 3.6x slower, clang/arm64 is 320x slower…
The speed is the highlight, but the simplicity is the real win - there’s no GPU setup boilerplate, no complicated annotations on code, no channels to set up and memory barriers to maintain, no cognitive load. It uses (a subset of, you can’t push an object onto a GPU) the same language for everything, and automatically manages all the data hazards. It can do that because the data movement is modelled at the IR/SSA level in the compiler.
Apple introduced ARC (Automatic Reference Counting) which was a huge milestone for ObjC, it removed a whole slew of memory bugs and complicated practices with the compiler stepping in to do it for you. This is “ARC for GPUs”, Automatic Resource Control, allowing data-parallel processing to become just another tool in your arsenal, with the compiler stepping in to do it for you.
Sorry, this is a bit gushing [grin], but I’m inordinately pleased with how well this works :)