NMH BASIC (http://t3x.org/nmhbasic/) is a tiny BASIC interpreter for the 8086 that I wrote in the mid-1990's. It runs in 12K bytes and includes a minesweeper game that runs on a TTY. Of course a 12K interpreter was an anachronism in the 90's, but it still was a fun project. #retrocomputing, #basic, #compilers, #dos, #8086
I found a great winter holidays reading. The book "Write Your Own Retro Compiler" by Nils Holm, which has just been published, describes the development of a self-hosting compiler that targets the Z80 on CP/M.
And it occurs to me to ask: does anybody else want to teach a class like this (i.e., focused on “mid-end” hacking and research)? I built a bunch of special infrastructure and would be delighted to help adapt it for another school/purpose/context/etc. if you want.
Finished reading "Type Systems for Memory Safety" https://borretti.me/article/type-systems-memory-safety by Fernando Borretti. It is a comprehensive review of various type system features across different #ProgrammingLanguages that are used to enforce (varying degrees of) memory safety at compile time.
As expected, it talks a lot about #Rust because Rust is probably the most used PL with compile time memory safety, but it features other languages like Ada, Val and Austral as well.
An interesting read if you are interested in #compilers.
I wrote the fourth part of my #blog series “Implementing Co, a small programming language with coroutines”. And this time, we add support for channels in Co for inter-coroutine communication. https://abhinavsarkar.net/posts/implementing-co-4/
I'm just now catching Andrew Whatson's talk on #PreScheme from #fosdem this year, and I just can't get over the fact that he was able to implement a working, reasonably fast systems programming language with Hindley-Milner type inference in his free time over the course of a few months. And I was in the #GuileSteel irc when the discourse first started, it was probably less than a month before he got it working. I even try it then and it seemed great for something that went up that quick. What other programming languages make rapid prototyping #compilers feasible without relying on massive frameworks like #LLVM or #Truffle/#Graal?
SectorC is a C compiler written in x86-16 assembly that fits within the 512 byte boot sector of an x86 machine. It supports a subset of C that is large enough to write real and interesting programs. It is quite likely the smallest C compiler ever written.
With some help from bjorn3 this was reasonably straightforward. I think the PRs are good templates for of someone wanted to work on a real compiler and implement further SIMD functionality. This issue lists some missing intrinsics
Ohai! #introduction
I am a software developer and started my journey almost two decades ago, so I formed some opinions on the way; I might contribute to some discussions.
I like talking about programming languages; expect posts about #golang, #rust, #ziglang, #perl, #compilers, #gamedev and #webdev
As a German #expat I lived in #sweden for years before moving to #valencia#spain. Expect comments about expat life, Spain and maybe some pictures.
Also, #drums, #dogs, #minimalism, and #coffee. 🦎
Phew, had me worried for a minute. I'm writing a simple XML 1.0 parser in #Rust just for practice, and on feeding it a 4.4MB XML file it took 56.5s to read it. I've done nothing to optimise it yet, but even so that sounded dire.
Then I remembered to use "release" mode, and the time dropped to 3.9s. Whatever the compiler is doing behind the scenes, I'll take that 14x speed boost, thank you.
A little over a year ago, originally due to an interest in the deeper history of #compilers, I started diving deep into the #Talmud, studying #Aramaic, #gematria, and doing #DafYomi etc in what has become my deepest engagement with the rabbinic corpus yet -- the Talmud isn't a compiler but rather an extensible interpreter, compiled by compilers over the course of many centuries (build times have gotten significantly faster, my G-d), with novel extensions in the form of rabbinic commentary, glossia and the like being added nearly every century by publishers competing to compile the most elegant editions (Vilna Shaws being paradigmatic). And through studying Talmud and the greater body of rabbinic literature I've found myself encountering #magic/sorcery occasionally, and I just gotta say -- the #SICP metaphor of programming as pure magic, with the #hacker as a sorcerer, goes insanely deep when you start to dig into it.
This is interesting but not new. Max Bernstein published two blog post series on implementing Lisp, one on writing an interpreter in OCaml and the other on a compiler in C.
So the thing about LLVM IR is, in reality it's a family of accidental and informally defined dialects. Every LLVM-based compiler for a particular machine target refines the input module down to its own idiosyncratic dialect.
Consequently there's way more latitude for confusion and bugs than you'd initially guess.
Try using an i65 type in an x86 backend. When I did that years ago it sailed right through and generated nonsense code.