I have been writing a scheme interpreter in c, and for me the most interesting aspect so far has been the level at which I am programming.<p>At the beginning it was very traditional c; symbol and AST manipulation were a PITA (at that point it was a malloc'd arrays of `expressions`).
After I had a base language working I started to use the language I had implemented so far to further the implementation, this finally peaked where this weekend I did a large refactor to remove most of my c arrays and instead replace them with scheme pairs and lists.<p>For example, here [1] I implement define function form in terms of lambda, specifically new_lambda(env, cons(args, cons(body, null))).<p>In hindsight this seems so obvious, but I have found the whole process extremely interesting, specifically looking at how the implemented languages starts to influence the implementation language.<p>I really cannot stress enough how enjoyable the process of writing my interpreter has been, I thoroughly recommend it to anyone who is interesting in programming languages.<p>[1] <a href="https://github.com/mkfifo/plot/commit/07272bd69e51979ab71fa08f6415978f46a3b4ee#diff-e2f93fafd9051a63d4bd310620ebd261R105" rel="nofollow">https://github.com/mkfifo/plot/commit/07272bd69e51979ab71fa0...</a>