Hacker News with Generative AI: Compilers

C Compiler to SPIR-V (github.com/heroseh)
HCC is a C compiler that allows you to compile your C codebase (with limitations) to SPIR-V for the Vulkan graphics API. This means you can share struct's, enum's and functions between your CPU & GPU code. HCC targets the future of GPU programming so is designed around features such as bindless resources and scalar alignment. This makes it easier to interop with the GPU and focus on writing shader code without writing your own shader build system.
AMD Developing Next-Gen Fortran Compiler Based on Flang, Optimized for AMD GPUs (phoronix.com)
AMD today went public with details on the "AMD Next-Gen Fortran Compiler" as a new Fortran compiler they are working on based on LLVM's Flang.
TinyCC Memory and Bounds Checks (bellard.org)
TinyCC (aka TCC) is a small but hyper fast C compiler.
Show HN: Jaws – a JavaScript to WASM ahead-of-time compiler (github.com/drogus)
Jaws is a JavaScript to WebAssembly compiler written in Rust. It is similar to porffor in a way it also results in a standalone WASM binary that can be executed without an interpreter, but it takes a different implementation approach.
Gccrs: An Alternative Compiler for Rust (rust-lang.org)
gccrs is a work-in-progress alternative compiler for Rust being developed as part of the GCC project. GCC is a collection of compilers for various programming languages that all share a common compilation framework. You may have heard about gccgo, gfortran, or g++, which are all binaries within that project, the GNU Compiler Collection. The aim of gccrs is to add support for the Rust programming language to that collection, with the goal of having the exact same behavior as rustc.
Why are ML compilers so hard? (2021) (petewarden.com)
Even before the first version of TensorFlow was released, the XLA project was integrated as a “domain-specific compiler” for its machine learning graphs.
Fitting a Forth in 512 bytes (2021) (compilercrim.es)
Software is full of circular dependencies if you look deep enough. Compilers written in the language they compile are the most obvious example, but not the only one. To compile a kernel, you need a running kernel. Linkers, build systems, shells. Even text editors, if you want to write the code instead of just downloading it.
A DSL for peephole transformation rules of integer operations in the PyPy JIT (pypy.org)
As is probably apparent from the sequence of blog posts about the topic in the last year, I have been thinking about and working on integer optimizations in the JIT compiler a lot.
Optimizers need a rethink (typesanitizer.com)
Intended audience: People working on, interested in, or adjacent to compiler and/or database development, and people who’ve been bitten by compiler/database optimizer failures in the past.
A Lisp compiler to ARM written in Lisp (ulisp.com)
This is a simple experimental Lisp compiler, written in uLisp, that will compile a Lisp function into ARM machine code. My aim was to make the compiler simple enough so that its listing will fit on a single sheet of A4 paper.
Show HN: Optimizing compiler for a large subset of C, written in Rust (github.com/xqb64)
This is a Rust implementation of the C compiler from Nora Sandler's book.
Workaround Clang v15 AArch64 miscompile that affects parallel collection (github.com/cisco)
This patch avoids a miscompile using Clang v15 on macOS.
Optimizing the Ion compiler back end (spidermonkey.dev)
In September, machine learning engineers at Mozilla filed a bug report indicating that Firefox was consuming excessive memory and CPU resources while running Microsoft’s ONNX Runtime (a machine learning library) compiled to WebAssembly.
The optimised version of 7-Zip can't be built from source (pileofhacks.dev)
If I was going to lean more into clickbait, I’d title this “7-Zip isn’t open source”. It’s likely if you’re on Linux you’re actually using a fork of it called p7zip, rather than the upstream project. If you’re on Fedora 40, you’re using a years-old version 1.
A Lisp compiler to RISC-V written in Lisp (ulisp.com)
This is a simple experimental Lisp compiler, written in uLisp, that will compile a Lisp function into RISC-V machine code. You can run the compiler on the RISC-V core of a Raspberry Pi Pico 2 (or another RP2350-based board):
An Update on Gccrs Development (lwn.net)
One concern that has often been expressed about the Rust language is that there is only one compiler for it.
GCC 15 Un-Deprecates Itanium IA-64 Linux Support (phoronix.com)
The GCC 14 compiler marked Itanium IA-64 support as obsolete with plans to remove that Intel architecture in GCC 15. But for now at least the Itanium Linux compiler support has seen some reprieve with it being un-deprecated.
PeachPie Compiler: Compile and run PHP on top of .NET runtime (peachpie.io)
Compile and run PHP on top the modern, secure and highly performant .NET runtime.
A Compiler Bug (2023) (rsaxvc.net)
Around 10 years ago, I found a bug in a vendor's compiler.
Prep: Golang Comptime (github.com/pijng)
prep is a small Go tool that enables compile-time function evaluation. By using prep.Comptime, you can evaluate functions at build time, replacing them with their computed results. Just like comptime from Zig. Except it's not.
Register Allocation in the Go Compiler (redhat.com)
The lost language extensions of MetaWare's High C compiler (2023) (duriansoftware.com)
This book I got in a pile of FM TOWNS books turns out to be a lot more interesting that I was expecting an '80s C compiler manual to be.
Rust panics under the hood, and implementing them in .NET (fractalfir.github.io)
I am currently working on a Rust to .NET compiler, rustc_codegen_clr. To get it to work, I need to implement many Rust features using .NET APIs. One of such features is panicking and unwinding.
Compiling to Assembly from Scratch (keleshev.com)
Have you been trying to learn how compilers and programming languages work?
ts-blank-space is a fast type-stripping compiler (bloomberg.github.io)
ts-blank-space is a fast type-stripping compiler that converts TypeScript to JavaScript. It supports a modern subset of TypeScript by erasing the types and replacing them with whitespace. That's it. It is not a type checker and does not perform any other code transformations.
Show HN: ts-blank-space – fast TypeScript type-stripper (bloomberg.github.io)
ts-blank-space is a fast type-stripping compiler that converts TypeScript to JavaScript. It supports a modern subset of TypeScript by erasing the types and replacing them with whitespace.
A high-performance, zero-overhead, extensible Python compiler using LLVM (github.com/exaloop)
Codon is a high-performance Python implementation that compiles to native machine code without any runtime overhead.
LLVM 19.1.0 Released (llvm.org)
A new Windows CE x86 compiler in 2024 (enlyze.com)
At ENLYZE we need to deal with operating systems from the last century on customer machines everyday.
Writing a Lisp compiler (Lisp to assembly) from scratch in JavaScript (2018) (eatonphil.com)
In this post we'll write a simple compiler in Javascript (on Node) without any third-party libraries. Our goal is to take an input program like (+ 1 (+ 2 3)) and produce an output assembly program that does these operations to produce 6 as the exit code. The resulting compiler can be found here.