-
How Many Types Is Too Many?
Position: Type annotations are ultimately undesirable when working with sufficiently-complex type systems, but there is no better solution. There is a point where a formally-verified compiler becomes indistinguishable from an automated theorem prover. Such a compiler can deduce a lot of information from a given language. Take, for example, a hypothetical, C-like language: int array_nth(arr,…
-
A First Look at the Manda Language
It’s still not public yet, but here’s a little bit about my current project. If you’ve read any of my “What’s New” posts, you’ll recall hearing about me working on the “Manda” language for the past two months. This isn’t true – I actually started in early 2018. class Tobe { fn complain -> print("I…
-
What’s New – Sep. 9th, 2019
Hello, to the maybe 5 people reading this! This blog has started to gather dust from the lack of usage. In all the years I’ve had this domain, I’ve written fewer than 30 blog posts. So, I decided that by logging what I’ve done been doing (roughly every month), not only can I hold myself…
-
AOT Compilation, Kernel, and other Dart Hackery
Tinkering around with kernel, Dart’s intermediate format… And more. Discuss on Hacker News: https://news.ycombinator.com/item?id=19844762 The continued development of Dart’s unified frontend (shared across the VM, dev compiler, dart2js, etc.) has made it possible for changes to be made to the language much more quickly. The common IR that Dart now compiles to is called kernel.…
-
Parsing String Interpolations with ANTLR4
ANTLR is probably the best-known parser generator out there, and for good reason. It’s a powerful LALR generator that also generates listener and visitor classes, in a multitude of programming languages. Combine this with ANTLR4’s special features, like lexer modes, and lexer/parser actions, and building DSL’s and compilers is a lot faster, because the number…
-
Building an Esolang JIT with GNU LibJIT
Just-in-time, or JIT compilation, is no new development at all; languages like Java, Python, and the countless languages running on the .NET framework have leveraged JIT compilation for many years now. It can be said that JIT compilation provides the best of the compiled and interpreted worlds: fast startup and high-level features, but execution at…
-
10 Key Differences between C/C++
It might seem like second nature after a while, but for those new to programming, the abundance of language options can often be overwhelming, especially when many seem similar at first, but have different features and use cases. In this video, I give a brief (~24 minute) presentation explaining 10 of the key differences that…
-
Compiler Writing: Pratt-Parsing Types
As much as we might like to think that data types are fixed in place, data types are actually just as mutable as the values they categorize. Consider the following: Given: A type exists, by the name of `Int`.Given: Another type exists, by the name of `List`. How, then, could we describe a type named…
-
Compiler Writing: A Basic Static Type System
Build a basic static type system, and prevent unnecessary runtime bugs! For many, if not all programming languages, a significant part of static analysis is data type analysis. If a compiler can categorize expressions into predictable types, then you can prevent many errors, such as passing a string into a function where an integer was…