mstdn.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general-purpose Mastodon server with a 500 character limit. All languages are welcome.

Administered by:

Server stats:

12K
active users

#compiler

8 posts8 participants1 post today

I'm writing a series of blog posts, in which I write a #bytecode #compiler and a #virtualMachine for arithmetic in #Haskell. We explore the following topics in the series:

- Parsing arithmetic expressions to ASTs.
- Compiling ASTs to bytecode.
- Interpreting ASTs.
- Efficiently executing bytecode in a VM.
- Disassembling bytecode and decompiling opcodes for debugging and testing.
- Unit testing and property-based testing for our compiler and VM.
- Benchmarking our code to see how the different passes perform.
- All the while keeping an eye on performance.

The second post of the series that focuses on writing the #compiler is now out: abhinavsarkar.net/posts/arithm

abhinavsarkar.net · A Fast Bytecode VM for Arithmetic: The Compiler
More from Abhinav 🌏

Two #blog posts in less than one week!

It was considered known that there is no support within GNAT (Ada) for illumos. We cross-build a complete native binutils+gcc toolchain for illumos to test out this claim.

...only to discover that illumos has full support within GNAT. Not a single test fails.

briancallahan.net/blog/2025081

briancallahan.netDespite thoughts to the contrary, GNAT (Ada) is in fact fully supported on illumos - Dr. Brian Robert Callahan
#Ada#illumos#GNAT

A new #blog post appears!

I discovered that the GNU D compiler has been broken on FreeBSD 14 for over a year and it seems no one noticed. Let's discover the issue and brainstorm some solutions to it.

A great case study for why operating system package maintainers matter.

briancallahan.net/blog/2025081

briancallahan.netThe GNU D compiler has been broken on FreeBSD 14 for over a year and no one noticed, or, why operating system package maintainers matter - Dr. Brian Robert Callahan

Adding the keyboard input routines to the emulator took a bit more work. Mostly trying to find the correct routines in (KeyPressed and ReadKey). (Read and Readln are both buffered - they read a line and only return when the user hits enter).

I want the command line compiler to be able to generate interactive console apps which can run in it's built in emulator.

The first step is to be able to hook the emulator to create 'breakpoints'. Here it's hooking the CP/M BDOS address, reading register values from the emulator, and overwriting the opcode (read by the emulator) with a RETurn.

Opting for a CP/M style API will give me some CP/M support already in the compiler.

I'm nearly finished with sub-range types in the compiler. Most of the work has been around range checking when assigning to a sub-range, and hundreds of tests against edge cases. The only tests now failing are a couple to do with function arguments and return values.

Range checks work when passing a literal or a variable, but this test shows a fail when passing the result of a expression.