CS371p Spring 2021 Week 2

Ethan Tan
3 min readJan 30, 2021

OOP Blog Post #2

What did you do this past week?

In between assignments and class, I wrote a lambda calculus interpreter! I learned lambda calculus in CS345 (Programming Languages) and it’s insanely simple, so this was a fun way to procrastinate on more important things. Right now it supports untyped lambda calculus but I might try to extend it to typed lambda calculus and implement Hindley-Milner type inference, and maybe eventually System F.

What’s in your way?

A bunch of paper. Whenever I need to think through something visually, I grab a sheet of notebook paper to use, then leave it on my desk for reference. It kind of just piles up, though, so the entire left side of my desk is unusable. It’s not too bad now, but tends to get out of hand as the semester goes on. I’ve heard good things about getting a whiteboard for this kind of stuff…

What will you do next week?

I think I might have some exams next week. It feels early, but I think I saw some early February dates on some of my syllabi. I really hope and expect next week to be busy in terms of my office hours — OS peeps have started the threads assignment and Dr. Gheith had to finish his lecture during discussion section, so I imagine it’ll be a pretty hectic week for them and I want to help in any way I can. Threads is just such a magical assignment; it brings together a little bit of everything—assembly, templates, queues, polymorphism, lambdas, and more — and wraps it into something neat, elegant, and extraordinarily important. Of course, I’ll also be completing this first project in OOP as well as my other assignments.

What did you think of the makefile?

The makefile wasn’t too hard to understand — I had to look up a few things on certain symbols or options. I’ve never written a makefile myself, although I have tried tinkering with some (mostly just breaking things, really).

What was your experience of Docker?

I haven’t used Docker yet, but I did manage to install it. It turns out it’s not enough to simply install Docker inside Ubuntu on WSL; I ended up installing it on Windows as well in order to get the daemon running.

What was your experience of assertions?

Assertions are great and were really useful in OS, due to the complexity of an operating system and the lack of safety typical programs have (exceptions, segfaults, etc.). It’s a lot easier to catch a violation of an invariant or a null pointer dereference before weird things start happening. Granted, debugging was still a pain, even with assertions.

What was your experience of unit tests?

I’m pretty horrible about writing unit tests and hopefully that changes.

What made you happy this week?

Writing anything in Haskell brings me great joy (except when I have to wrestle the ST Monad), so my lambda calculus interpreter.

What’s your pick-of-the-week or tip-of-the-week?

If anyone is interested in learning Haskell, Tsoding has some very informative, beginner-friendly videos on various topics. He has a playlist on solving HackerRank problems in Haskell that I think are really useful if you’re new to Haskell.

--

--