Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: compiler Clear Filter

Working through 'Writing A C Compiler'

Some time ago I decided I wanted to create a c compiler for the Hack processor in the nand2tetris book. After several dead end attempts that I might describe later I found this book : Writing a C Compiler | No Starch Press I decided to work my way through it. I plan to do blog posts as I progress through it, probably chapter by chapter. I have emailed the author a couple of times and have got helpful timely replies! – thank you What makes the book so good? Step by step By the end of chapter

Berry Script: lightweight embedded scripting language for microcontrollers

What is it ? Berry is a ultra-lightweight dynamically typed embedded scripting language. It is designed for lower-performance embedded devices. The Berry interpreter-core's code size is less than 40KiB and can run on less than 4KiB heap (on ARM Cortex M4 CPU, Thumb ISA and ARMCC compiler). The interpreter of Berry include a one-pass compiler and register-based VM, all the code is written in ANSI C99. In Berry not every type is a class object. Some simple value types, such as int, real, boolean

Building the Rust Compiler with GCC

Bootstrapping Rust with GCC If you know one thing about me, it is that I love working on the Rust compiler. Some people kayak, travel or play guitar - and I stare at assembly, trying to figure out what I broke. This summer, I am taking on quite a large task: bootstrapping the Rust compiler using `cg_gcc` What does that mean? "bootstrapping" is simply a name given to the Rust compiler build process. So, what I am really trying to do is build a Rust compiler, without using LLVM - and using GCC

The messy reality of SIMD (vector) functions

We’ve discussed SIMD and vectorization extensively on this blog, and it was only a matter of time before SIMD (or vector) functions came up. In this post, we explore what SIMD functions are, when they are useful, and how to declare and use them effectively. A SIMD function is a function that processes more than one piece of data. Take for example a mathematical sin function: double sin(double angle); This function takes one double and returns one double. The vector version that processes four

LLMs as Compilers

LLMs as compilers 7/2/2025 by Kadhir So far, I've only used LLMs as an assistant, where I'm doing something, and an LLM helps me along the way. Code autocomplete feels like a great example of how useful it can be when it gets it right. I don't doubt that over time this will improve, but I'm excited to see a more significant transition from this assistant mode to a compiler mode, at least for coding. It will be exciting when we focus solely on the context we fed the LLM, then test the features

WebAssembly Troubles part 4: Microwasm (2019)

WebAssembly Troubles part 4: Microwasm Preamble This is the final part of a 4-part miniseries on issues with WebAssembly and proposals to fix them. Part 1 here, part 2 here, part 3 here. This article assumes some familiarity with virtual machines, compilers and WebAssembly, but I’ll try to link to relevant information where necessary so even if you’re not you can follow along. Also, this series is going to come off as if I dislike WebAssembly. I love WebAssembly! I wrote a whole article about h

Whitesmiths C compiler: One of the earliest commercial C compilers available

Whitesmiths, Ltd. C Compiler Background The original Whitesmiths compiler was released in 1978 and compiled a version of C similar to that accepted by Version 6 Unix. It was an entirely new implementation, borrowing no code from Unix. When Whitesmiths released version 3.0 of its C compiler in 1985 it supported the emerging ANSI C standard. The Whitesmiths compiler had code generators for DEC PDP-11, Intel 8080/Zilog Z80, Intel 8086, Motorola MC68000, DEC VAX-11, IBM System/370 and IBM System

Compiler for the B Programming Language

B Programming Language Warning Compiler is not fully implemented yet. Logo by Strawberry 🍓 Compiler for the B Programming Language implemented in Crust Dependencies Rust - the compiler is written in it; fasm - used as the compiler backend; Quick Start $ make $ ./build/b -run ./examples/hello_world.b Also check out more examples at ./examples/. Testing The project comes with btest utility which tests the B compiler. It is built automatically along with the B compiler when you do make .

Literate programming tool for any language

Literate What is Literate programming? Literate programming is a style of programming invented by Donald Knuth, where the main idea is that a program's source code is made primarily to be read and understood by other people, and secondarily to be executed by the computer. This frees the programmer from the structure of a program imposed by the computer and means that the programmer can develop programs in the order of the flow of their thoughts. A Literate program generally consists of expla

I Wrote a Compiler

I have a Computer Science degree. I attended a whole course of lectures on compilers (and have a certain fondness for “the red dragon book” as a result). However, I had never actually written a compiler from start to finish until a rainy day last weekend. Yes, this is what I do for fun. I wanted to make a compiler for a real language, but a simple one so I could complete the project in a few hours. I’ve always had a bit of a soft spot for BASIC - it’s the first progamming language I learned as

Using `make` to compile C programs

I have never been a C programmer but every so often I need to compile a C/C++ program from source. This has been kind of a struggle for me: for a long time, my approach was basically “install the dependencies, run make , if it doesn’t work, either try to find a binary someone has compiled or give up”. “Hope someone else has compiled it” worked pretty well when I was running Linux but since I’ve been using a Mac for the last couple of years I’ve been running into more situations where I have to

Rust compiler performance

Perhaps the most often repeated complaint about Rust is its slow feedback loop and long compilation times. I hear about it all the time; in Rust podcasts, blog posts, surveys, conference talks or offline discussions. I also regularly complain about it, being a Rust user myself! Recently, in addition to the usual compile times complaints, I also started noticing the following sentiments being expressed by frustrated Rust developers: “Why doesn’t the Rust Project care more about this pressing and

TinyCompiler: A compiler in a week-end

TinyCompiler: a compiler in a week-end Introduction Have you ever wondered how a compiler works, but you never found courage to find out? Then this series of articles is for you. I have never had the chance to look under the hood either, but one week-end I have decided to to write a translator from the esoteric programming language wend (short for week-end), which I just invented myself, into regular GNU assembly. The goal is to keep the code as tiny as possible, 500-ish lines of python sounds