I wrote my first programming language! I named it Wilfrid, after Wilfrid S. Sellars, a great philosopher of the analytic tradition.

You can check the language’s interactive demo here, along with code examples and tutorial-style introduction to the syntax and basic features.

Wilfrid’s source code is available on GitHub.

Despite being written for my personal, educational reasons, Wilfrid is fairly fully-featured. It could be best described as a low-level, general-purpose, C-like language with some improvements in usability, such as:

  • cleaner, Go-style syntax
  • stricter type checking with limited implicit conversions
  • optional garbage collection
  • built-in dynamic arrays
  • function overloading
  • order-independent declarations

It also retains full interoperability with C.

Wilfrid can be compiled to C or run in the interpreter, featured on the demo site. Both compiler and interpreter are written in C, with no external libraries.

Current limitations of the language are mostly the lack of support for modules and namespaces, and no function pointers. Also, Wilfrid has no standard library of its own, except for dynamic arrays, memory arenas, and some string functions. So for now it must rely on the C standard library via extern functions. Fortunately, Wilfrid types have strict counterparts in C types, so the interoperability is seamless.

In writing Wilfrid, I relied heavily on the following sources:

  • “Bitwise” series by Per Vognsen – link
  • “Crafting Interpreters” by Robert Nystrom – link
  • “Compiler Construction” by Niklaus Wirth – link
  • “Conservative GC Algorithmic Overview” by Hans-J. Boehm – link
  • “Writing a Simple Garbage Collector in C” by Matthew Plant – link

As of now, Wilfrid should be considered being in the early alpha stage. Since this is my very first programming language, I probably missed a ton of issues!