Thomas Leonard was working on rewriting 0install with OCaml. He previously wrote about how going from Python to Ocaml, he lost surprisingly little. The port is now complete, and he is back to tell us what you gain from OCaml. Good read; might motivate you to give OCaml a shot.
Among other things, he mentions OCaml’s “polymorphic variants”. It is a lovely feature, which once you look at, you may miss in every other language.
Thomas’ blog has many other gems - tips for OCaml, looking back at bugs he faced and whether they could have been prevented, overview of OCaml async libraries etc. Read it!
Marvel comics has an API! It gives you access to “data about Marvel’s vast library of comics — from what’s coming up, to 70 years ago”. Sounds exciting, right? Sign up, and play around.
Chris Ford made an interesting statement on twitter last week - “I now realise that Orwell’s ‘Ignorance is strength’ becomes Philip Wadler’s ‘Theorems for free’ when applied to types”. It reminded me of these recent Tony Morris slides on the subject. The slides have many good examples that illustrate how parametricity can help you reason about code better.
Coursera was built in PHP. As they reached a customer base of 6+ million and 500+ courses, they realized it wouldn’t work for them any more. They evaluated Python and Scala for stacks to switch to, and decided to go with the latter. As per the report, the choices have worked out very well for them. They were able to leverage Play and Akka to handle a high amount of traffic that the site receives. They also seem happy with the IDE and build tool situation of Scala ecosystem.
I absolutely love pattern matching. After using it for years, I still remain surprised by how easy it makes it to reason about code, how it aids readability, how concise it can make your code, and the way it can help you prevent subtle bugs.
One thing that leaves much to be desired however is the way pattern matching is implemented in most languages. It’s all at the language level. It doesn’t blend too well with the world of functions. The extensibility is fairly limited, and often needs additional bells and whistles like Scala’s “extractors” or Wadler’s “views”.
All of these problems could be alleviated if “patterns” and “clauses” are made first-class values. (Yes, first-class all the things!) Reiner Pope and Brent Yorgey’s
Data.Pattern does exactly that. Take a look at
Data.Pattern.Common to see how beautifully it achieves this goal. IMO, after Control.Lens, this is the most amazing Haskell library ever.
Newspeak is a dynamically typed, object oriented language, in tradition of Smalltalk. This very detailed paper presents first-class patterns for Newspeak. You’ll notice that it features many things from the Haskell implementation, and then some. The two being very different languages however, the implementation strategies differ. Bindings, in particular, are done very differently.
Chris Marshall is a known name in Scala circles, largely due to his contribution on StackOverflow. Here’s his recent interview with SkillsMatter.
I love the advice he gives regarding the importance of logging. It resonates well with my own experiences and views on the subject.
This nice little post illustrates how typing discipline can be helpful in mathematics. I guess implementing a mathematics library in a dependently typed language may give a good taste of the kind of impact this may have.
The summary is, there have been a number of studies showing nicotine patches are safe to consume and can enhance cognitive functions in many ways: alertness, attention, memory, psychomotor speed etc. For some godforsaken reason, however, most neuroscientists still wouldn’t recommend its use. Probably they want more studies to assure its safety. But do you? ;-) And hey, you didn’t hear it from me.
Until next time!
This blog post was originally posted at my Blogspot blog at this URL.