Small Programs and Languages

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
sponsored
  1. mortar

    Toy compiler for a native language (by abainbridge)

    I'm interested in making a really simple compiled scripting language. I don't understand why most scripting languages compile to bytecode and then interpret that. This requires the following steps:

    1: Design a bytecode. 2: Write a compiler. 3: Write an interpreter.

    It seems like it would be simpler to not bother with 1 and 3 and instead use machine code as the bytecode. A side benefit is that programs will run faster.

    I think it is easy to generate machine code for x86_64, ARM64 and risvc64, as long as you don't mind it being 3x larger and slower than an optimizing compiler would generate. It ought to be easy because it is possible to only target the common subset of features these architectures support.

    I made a start, https://github.com/abainbridge/mortar, but haven't got much past being able to compile and run a Fibonacci sequence generator. I have no experience with language design or compiler implementation.

    Any comments or suggestions, including, "Don't bother, here's one I wrote earlier..."?

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. bnfc

    BNF Converter

    You may find the following useful for some necessary background;

    Implementing Programming Languages: An Introduction to Compilers and Interpreters by Aarne Ranta (<150 pages!) - https://www.grammaticalframework.org/ipl-book/

    The above book uses the BNF Converter Tool - https://bnfc.digitalgrammars.com/

    BNF Converter Tutorial - https://bnfc.digitalgrammars.com/tutorial/bnfc-tutorial.html

    For code generation, you can just walk the AST and emit the text of the assembly code for x86_64/ARM64/RISC-V and then leave the rest to the system assembler.

    From your github i see you mention the "MicroC" subset of C language. Maybe follow the above book but with the syntax/grammar of MicroC for your implementation.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • The BNF Converter

    1 project | news.ycombinator.com | 4 Feb 2025
  • How I Choose Which Open Source Issue to Work On (After Picking Wrong Ones)

    1 project | dev.to | 5 Nov 2026
  • How I Extended a Refaster Rule in Picnic's error-prone-support (and Recovered a PR GitHub Broke)

    1 project | dev.to | 3 Nov 2026
  • Modernizando Java legado com IA - o que funciona e o que dá errado

    1 project | dev.to | 30 Oct 2026
  • Show HN: ISPA – Parser generator with grammar-level debugger and error recovery

    1 project | news.ycombinator.com | 26 Oct 2026

Did you know that TeX is
the 32nd most popular programming language
based on number of references?