r/programming • u/wordbit12 • 8h ago
r/programming • u/realguy2300000 • 3h ago
kav: a purely functional systems language with a small & fast compiler implemented in C
srcdump.neti’ve been working on this for a while and i think im ready to show it off a bit :)
i started working on this project after getting excited by functional programming and type systems after learning some haskell, followed by some ATS. kav takes ideas from both but it’s also quite different. the language makes uses of linear and dependent types, compiled with functional purity, which is both safe and fun to program in. however, i won’t go into too much detail about the language design but more about the compiler implementation.
the compiler is fairly compact (about 6000 lines, although liens aren’t everything it gives you a ballpark idea of the scale) and implemented in portable C11, using bidirectional type checking and a small fourier-motzkin solver for proving index constraints. it uses QBE as the backend, which is also fairly compact and implemented in C. this makes the compiler pretty fast, and easy to bootstrap even from one of the more primitive C compilers.
the lexer is generated using re2c, but most of the actual re2c regex is generated using an X-macro of the list of tokens, which makes it very easy to add new keywords to the language.
the languages runtime is also tiny and not dependent on libc or a C compiler, which means the binaries are tiny and linking is quick. it uses a small bump allocator with free-lists for allocation. this is written in C, and ten compiled to qbe using the cproc C compiler. then that generated qbe code is linked into every binary as the runtime allocator.
the compiler is very fast, it takes about 30ms on my machine to compile a fairly substantial amount of kav code (most of that is qbe/assembler/linker which are out of my control, the frontend only takes a few ms)
there is also a standard library, which is not finished, but has enough to write some fun programs (i’m working on a posix make implementation)
i’m pretty excited about this and i’d love more people to get involved or just to try it out.
r/programming • u/alexeyr • 1d ago
Google rushed to replace its P-256 signing key in Chrome 11 days before the NSA's AI cryptography warning
xda-developers.comr/programming • u/shubham0204_dev • 4h ago
How Userspace CUDA Programs Communicate with NVIDIA GPUs on Linux
shubham0204.github.ioTo check how a simple vector addition CUDA program communicates with the kernel, I started by using the strace utility and found nearly all of them to be ioctl system calls. Being new to ioctl, I dived deeper and ended up learning more about the Nvidia Linux kernel modules and how they communicate with the GPU device via PCIe.
I have included the details in my latest blog 'How Userspace CUDA Programs Communicate with NVIDIA GPUs on Linux'. Do read it and let me know your thoughts!
r/programming • u/alexeyr • 1d ago
Precision in type system design (or the Option type as an anti-pattern)
dashbit.cor/programming • u/Fantastic_Wave1982 • 1d ago
Let's Understand Redis Source Code From Scratch
sushantdhiman.devr/programming • u/modulovalue • 1d ago
ASCII Validation from 2.5 to 114 GB/s with SIMD
modulovalue.comr/programming • u/Rodrigodd_ • 23h ago
Embedded Rust from Scratch
rodrigodd.github.ioI recently got a small microcontroller, and I thought it was a good opportunity to learn more about how ARM-based microcontrollers work under the hood and how Rust works on embedded devices. In this blog post, I go over how to implement a very basic example application in Rust from scratch, covering everything from runtime initialization to how to build memory-safe abstractions for peripherals.
Hopefully, preexisting knowledge of Rust or embedded development is not required to follow the post.
r/programming • u/DanielRosenwasser • 2d ago
Announcing TypeScript 7.1 RC
devblogs.microsoft.comr/programming • u/simon_o • 2d ago
Wax: A User-Friendly Syntax for WebAssembly
tarides.comr/programming • u/gerlacdt • 2d ago
Team Topologies in Enterprise IT: Navigating Cognitive Load, Platform Design, and Team Autonomy
gerlacdt.github.ior/programming • u/NorfairKing2 • 1d ago
Tristan Mc Leay - Mutation Testing With Sydtest
youtube.comr/programming • u/Cool-Click1253 • 2d ago
How a tiny HTTP response preview ended up buffering a 64 MB download
octri.devr/programming • u/nukethebees • 2d ago
Heterogeneous collections using compact handles
nukethebees.comr/programming • u/MarekKnapek • 2d ago
SNIA SDC2026 - SMB3 POSIX Extensions: From Plumbing to Flowing
youtube.comr/programming • u/BrewedDoritos • 2d ago
A Vision for Pascal 2030 at EKON
blogs.remobjects.comr/programming • u/_reddit_lovers_ • 1d ago
In 1936 a "computer" was a person with a pencil. Ten years later it was a 30-ton machine. I made a 10-minute video on how that happened.
youtu.beI've been making a short video on the decade between Turing's 1936 paper and ENIAC, and the part that surprised me most was how slippery "first computer" is:
- Zuse's Z3 (1941) was program-controlled, but built from relays.
- Colossus (working by the end of 1943) was electronic, but built for one job.
- ENIAC (1945) was electronic and general purpose, but had no stored program. Programming it meant plugging cables by hand.
- The Manchester Baby (21 June 1948) was the first to run a program held in electronic memory.
So the answer depends on which of those properties you count.
The video also walks through a tiny Turing machine that adds one to a number, and the six women who programmed ENIAC. I tried to keep it accurate and listed my sources (Turing's paper, Penn, the Computer History Museum, IEEE Spectrum) in the description.
Full disclosure: this is my own video. I'd really like corrections from people who know this period better than I do, especially on the stored-program credit, which I know historians still argue about.
r/programming • u/jackdbristow • 3d ago
What to Make of the NSA Advisory
words.filippo.ior/programming • u/iloveafternoonnaps • 2d ago
Java Virtual Threads vs Elixir: Comparing Memory, CPU, Process Termination
youtube.comr/programming • u/Ok_Stomach6651 • 2d ago