Kjetil Valle Interview

This week we have Creating Programming Language from Scratch trainer Kjetil Valle on the line. Thank you Kjetil for taking the time to talk with us. If you wanna visit his training, make sure to get your ticket as the seating is limited.

Tell us a bit about yourself?

Hi! My name is Kjetil, and I’m from Oslo, Norway, where work for a local consultancy. I’ve been working with different customers in the public sector for the last six years. I’m passionate about helping the local programming community, and have been organizing conferences and meetups in Oslo for a number of years, mostly with a focus on functional programming. When I’m not programming or organizing, you’ll probably find me out somewhere tasting a new beer, or playing board games with friends. Or both!

How did you get into programming?

I actually didn’t start programming until I got to university. I had been copy-pasting and making changes to some JavaScript now and then before, but didn’t have a good understanding of what I was doing. In university I mainly used Java, C and Python, of which I strongly preferred the latter. This was, as I found later, because I there could write code in a somewhat more functional way.

How did you get into functional programming?

My first brush with functional programming must have been with the language Oz, which we learned in a course on programming with different paradigms. After this I started playing around with various new languages, and tried out Prolog, Lisp (Scheme, mostly), Haskell, and some others.

These days I’m mostly into Elm; It not only let me write frontend code in a clean and functional way, but I also get to use it in projects at work. I actually like Elm so much I helped organize the first ever Elm conference in Norway (and only the third in the world!) back in June.

Why that tech?

I think my first inspiration for implementing a simple programming language was reading the article The Roots of Lisp by Paul Graham. I read his description of how Lisp works, and almost couldn’t believe that was all there was to it. So I read John McCarthy’s original paper and found it really was, and figured I’d give it a shot, which resulted in an implementation in Python.

After finishing the core of the language I had a lot of fun adding different new features. For instance, the original Lisp has dynamically scoped functions, so I changed that to lexical scoping, which virtually all languages use nowadays.

Why that talk?

After playing a round with my toy language for a while I had written a number of tests. (I implemented it in Python, after all…) I figured that if I removed the actual implementation, people might be able to re-implement it by simply using the tests as a guide (and not having to read the papers and other literature).

That didn’t turn out to quite be the case: I had to add a lot more tests. But after doing that—and writing some descriptions of what we were doing along the way—the workshop was born!

I really like giving this workshop. I had some proper “ah!”-moments making it, and I enjoy seeing other people going through the same. One such is the realization that function closures are just simple data structures. Another is the feeling of writing code in the language you’ve implemented yourself just minutes ago.

Another reason I like doing this workshop is that it’s completely test driven, which means that people are working at their individually preferred pace. Some people might race through, while other might only get past the first few exercises, but both groups tend to have fun and learn a lot along the way :)