LP: CS51– Polymorphism and Higher-Order Functions

When you’re completing a whole 4 year course in one year, the difference between completing a course in 10 days vs 7 days can be quite astonishing. And I feel like I’m lagging a bit.

Right now I’m at Lecture 4 of CS51, while also completing the third Problem set.

Problem Set 2 (which is the third one because of zero-indexing) is divided into two parts, the first part involving writing Higher Order Functions.

Finishing it was a lot of fun! (Which was literally my commit message in github).  Robert Fischer once said that “Ocaml” will warp your mind, and my mind had successfully been. Implementing Higher Order Functions- in which we were not allowed to touch signatures mind you, have opened my thinking to a very different programming paradigm. It was surprisingly exciting to use function composition and list mapping to what otherwise could be solved by a simple for loop, and function currying was both yummy and useful. The level of abstraction that feels always within reach is a very deep one, and I feel I understand recursion in a much more meaningful way.

However, there was an ominous message in the very beginning that seem to warn of a challenge coming in the horizon:

(* TIME ADVICE:
* Part 2 of this problem set (expression.ml) can be difficult, so be careful
* with your time. *)

Part 1 was fun! It was intuitive! It was great! Until I reached part 2.

The second part involved writing a freaking Language for Symbolic Differentiation!
Now, now, with all the things I learned up top, I should be able to do it right? However that doesn’t change the fact that it is both time-consuming AND challenging. I just discovered Scott Young, my big senpai in taking this course, took some of the programming assignments in parallel to other courses, which makes a butt-load of sense really. As stated in the very start of this particular learning project (that is, CS51), I was still deciding whether or not I take another course in parallel, and this option is appealing a bit more to me right now.

DerivRules

The Calculus. Be afraid of the Calculus!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s