Skip to content

🐱 v0.1.0 β€” First Release!

Choose a tag to compare

@mattleibow mattleibow released this 06 Feb 22:26
· 36 commits to main since this release

A complete LOLCODE 1.2 compiler for .NET 10. Write LOLCODE, get real .NET assemblies.

HAI 1.2
  VISIBLE "OH HAI! I CAN HAZ COMPILER!"
KTHXBYE

✨ What's Included

Full LOLCODE 1.2 Language Support

  • Variables & Types β€” NUMBR (int), NUMBAR (float), YARN (string), TROOF (bool), NOOB (null)
  • Math β€” SUM OF, DIFF OF, PRODUKT OF, QUOSHUNT OF, MOD OF, BIGGR OF, SMALLR OF
  • Booleans β€” BOTH OF, EITHER OF, WON OF, NOT, ALL OF, ANY OF
  • Comparison β€” BOTH SAEM, DIFFRINT (no auto-casting, per spec)
  • Conditionals β€” O RLY? / YA RLY / MEBBE / NO WAI / OIC
  • Switch β€” WTF? / OMG / OMGWTF with fall-through semantics
  • Loops β€” IM IN YR with UPPIN, NERFIN, TIL, WILE, GTFO
  • Functions β€” HOW IZ I / IF U SAY SO / FOUND YR / I IZ func MKAY
  • Casting β€” MAEK x A NUMBR, x IS NOW A YARN
  • Strings β€” SMOOSH concatenation, :{var} interpolation, escape sequences (:), :>, ::, :", :o)
  • I/O β€” VISIBLE (print with infinite arity), GIMMEH (read input)
  • Comments β€” BTW (line), OBTW...TLDR (block)
  • IT β€” Implicit per-scope variable, auto-returned from functions

Roslyn-Inspired Compiler Architecture

Hand-rolled, multi-phase compiler β€” no parser generators, no transpiling to C#:

Source (.lol) β†’ Lexer β†’ Parser β†’ Binder β†’ Lowerer β†’ CodeGenerator β†’ .NET DLL
  • Rich diagnostics with source location, line/column info, and LOLxxxx error codes
  • Immutable syntax and bound trees
  • Each phase independently testable

MSBuild SDK Integration

Build LOLCODE with standard .NET tooling:

dotnet new install Lolcode.NET.Templates
dotnet new lolcode -n MyApp
cd MyApp
dotnet run    # β†’ HAI WORLD!

File-Based Apps

No project file needed:

echo '#:sdk Lolcode.NET.Sdk
HAI 1.2
  VISIBLE "HAI WORLD!"
KTHXBYE' > hello.lol
dotnet run --file hello.lol

16 Sample Programs

Organized into categories with dotnet run support:

  • Basics (9) β€” hello-world, variables, math, conditionals, loops, functions, string-ops, casting, switch
  • Programs (4) β€” fizzbuzz, fibonacci, recursion, string-calculator
  • Games (3) β€” guessing-game, adventure-game, arena-game

289 Tests Across 2 Projects

  • Unit tests β€” Lexer (32), Parser (25), Runtime (86)
  • End-to-end tests β€” 19 category classes covering every language feature
  • SDK integration tests β€” all 16 samples verified

πŸ“¦ NuGet Packages

Package Description
Lolcode.NET.Sdk MSBuild SDK for .lolproj projects
Lolcode.Runtime Runtime library for compiled LOLCODE programs
Lolcode.NET.Templates dotnet new lolcode project template

πŸš€ Quick Start

# Install the template
dotnet new install Lolcode.NET.Templates

# Create and run a LOLCODE app
dotnet new lolcode -n MyApp
cd MyApp
dotnet run

Requirements

  • .NET 10 SDK

Full Changelog: https://github.com/mattleibow/dotnet-lolcode/commits/v0.1.0