Use Your Language

intermediate

You’ve built a small programming language. Now use it.

The previous problems were about building the evaluator — adding rules for numbers, operators, variables, functions, conditionals, recursion, and closures. This problem is different. The evaluator is done. You won’t change it.

Instead, you’ll write programs in the language you built, using only what’s already there.


Why This Matters

When you were building the evaluator, you read expressions like ["if", ["n", "==", 0], 1, ...] and thought “what does my evaluator need to do with this.” Now you’ll read those same expressions and think “what does this program compute.” That’s a different skill — and it’s the one programmers actually use.


What You’ll Do

You’ll write ten programs of increasing difficulty, starting from a one-line function and ending with boolean logic built from scratch. Along the way you’ll write curried functions, nest conditionals, combine recursion with currying, discover function composition, and derive boolean operators from nothing but if.

By the end, you’ll have a feel for what your language can express — and a sharp sense of what it can’t yet.

Steps