Parsing CSS file with monadic parser in Clojure
Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
|(:require [clojure.java.io :as io]|
|[cljs.compiler :as comp]|
|[cljs.analyzer :as ana]))|
|(defn read-file [file]|
|(let [eof (Object.)]|
|(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))]|
|(vec (take-while #(not= % eof)|
|(repeatedly #(read stream false eof)))))))|
Kris Nuttycombe asks:
I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?
I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.
I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.
This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.
Keep it simple, stupid. You ain't gonna need it.
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.