Student turns binary-tree assignment into a C-based functional language
A data structures exercise to evaluate arithmetic expressions like 1+1+1 using a binary tree led one developer to build a full evaluator in C. The project expanded to include closures, a garbage collector, a custom memory allocator, a REPL, and a foreign function interface, dubbed graphLang. The author generalized arithmetic operators into a single function-application abstraction rather than separate cases for Add, Sub, Mul, and Div.
GoKawiil's interpretation of the reporting above, not reported fact.
The project illustrates how a simple academic exercise can reveal deeper principles of programming language design, such as unifying operations under a common functional abstraction. It also shows the practical challenges of implementing high-level language features like variable bindings in a low-level language like C, which lacks built-in hash tables.
- A binary-tree evaluation assignment evolved into a full interpreter project called graphLang.
- The developer implemented closures, garbage collection, memory allocation, a REPL, and FFI in C.
- The design generalizes arithmetic operators into a single 'function application' expression type, simplifying the evaluator's logic.
Source: hereticpleb.vercel.app — Pranav Desai, 2026-09-29
Published there as: “Needed 1+1, built a functional programming language”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.