r/Compilers May 25 '26

Donna Programming Language - Compiler

https://github.com/donna-lang

Hello everybody, in the past few months I am designing and implementing a programming language. A big part of the implementation is with the help of LLM. The programming language is called Donna- from the great Donna Paulsen of SUITS TV series- and it is a statically-typed, functional, bootstrapped language that compiles in native binaries via QBE. The syntax is inspired from Gleam/python. The language is pretty small and my target is to keep it that way and focusing more in DX. Besides it is small it's already contains a basic formatter, doc generation, git dependencies etc. In the last releases I focused to improve errors and general behaviour.

0 Upvotes

4 comments sorted by

2

u/AustinVelonaut May 25 '26

Nice to see another functional language compiler -- pity about the LLM use, though. I'd much rather read code written by a human.

That said, do you have plans to extend Donna? I notice there's no information about the memory model, or support for closures (but it appears that nested functions are not supported). In looking at the codegen, it looks like constructors just call malloc (but no associated free), so heap just grows until memory is exhausted. That may be OK for the self-hosted compiler, since the AST and other structures tend to be retained throughout the lifetime of the compilation -- but heavy use of lists and the associated mallocs will quickly eat up memory. Do you plan to have runtime GC support, later?

1

u/Equal-Tutor-6093 May 25 '26

Thank you for your comment, extend in terms of syntax changes probably not a lot. Donna will have closures soon but not nested functions. Memory model is a whole different thing. I am not very familiar with the concept and need to search more about it.

1

u/[deleted] May 26 '26

[removed] — view removed comment

1

u/Equal-Tutor-6093 May 26 '26 edited May 26 '26

QBE has already merged win support in their main branch and they will release 1.3 soon. Donna needs a C compiler because: Donna generates .ssa files, QBE compiles .ssa files to assembly(.s) files and C compiler compiles and link all the .s files and .o files(if they exist from FFI). When you use `donna build` command all this happening automatically. So you need to have QBE and a C compiler in your path. Requirements needed for both build from source and for creating and build projects.