As I'm sure a decent portion of you are, I'm essentially a self-taught programmer. I started with R as a Data Analyst, and moved on to Python and (a little) Scala. I recently just joined the dev.to community, and one of the first things I noticed was a link to the "first year in code" e-book. I ended up reading it, then getting directed to https://teachyourselfcs.com.
Conceptually, I get it, but push come to shove, it slips from the mind. I didn't want to be one of those people that didn't "quite get recursion or Big O notation". So I decided to work my way through MIT's Structure and Interpretation of Computer Programs.
The original book was written with the Scheme variant of Lisp in mind, and I already knew a decent amount of Python syntax, so I decided.. I'm going to redo as much of the book as I can in Hy!
Hy is a wonderful dialect of Lisp that’s embedded in Python.
Since Hy transforms its Lisp code into the Python Abstract
Syntax Tree, you have the whole beautiful world of Python
at your fingertips, in Lisp form!
This essentially means you could make a Django web-app, in Lisp syntax! A Scikit-learn Machine Learning Pipeline with Flask, in Lisp syntax! Neat, right?
It also allows threaded macros, similar to Clojure:
(require [hy.contrib.loop [loop]]) (loop (print (eval (read)))) ; instead you can do (require [hy.contrib.loop [loop]]) (-> (read) (eval) (print) (loop))
I'm not sure how common of a problem it is, but I absolutely can't resist copying and pasting code after a bit of time spent on a problem if I'm reading a book on a subject. This is a way to force myself into learning the problems myself, at least, most of it (Hy more closely matches common lisp than scheme, so you can't copypasta your way out of it).
Plus, I've always thought learning weird little side languages is kind of cool, and hopefully I've introduced Hy to those of you who didn't realize it was a thing.
I've been putting my notes and progress in my github at:
I've been using Jupyter to test things out, this took a little bit of finangling, but, the easiest thing to do is to do what's mentioned in the Calysto (Hy's Jupyter kernel) issues list if you run into installation errors. It's what worked for me on Ubuntu 18.04 LTS.
To run the hy metakernel on Jupyter console and notebook I used following commands: $ pip3 install --user --force-reinstall ipython jupyter jupyterlab $ pip3 install --user --force-reinstall metakernel ipyparallel $ pip3 install --user --force-reinstall git+https://firstname.lastname@example.org $ pip3 install --user --force-reinstall git+https://github.com/Karrq/calysto_hy.git $ pip3 install --force-reinstall jupyter $ python3 -m calysto_hy install --user $ jupyter console --kernel calysto_hy $ jupyter notebook --notebook-dir=.jupyter/
This will allow you to use it in a Jupyter notebook. I would like to get to the point where I do some machine learning and maybe make an app in Hy, just to say I could.
Of course, the original purpose was to strengthen my computer science concepts in an interesting way (and to use a squid emoji, since there's no cuttlefish ones ): )
Does anyone else have any methods of learning computer science or books they recommend? I'm curious if there's any gamification going on or quirky little things I've missed out on. I was considering working my way down the "teachyourselfcs" list.