My long articles, which you perhaps even might want to print.
In this categoryPosts in this category, from newest to oldest:
Scala offers different programming paradigms, from object oriented programming (OOP) all the way to functional programming (FP). Most Scala developers come from OOP and know OOP classes and inheritance well, but lack familiarity with algebraic data types commonly used in functional programming. In this article we aim to explain algebraic data types and their use in Scala.
We start with a simple formal notion of a type and combine simple types with sum and product types to introduce algebraic data types. We then show how Scala encodes these types, with some comparison to Haskell to illustrate the boilerplate Scala imposes for these types. Noticing similarities between certain combined types we now take a look at generics and isomorphisms between types. We conclude with some remarks about the effects of subtyping which comes with sum types in Scala, and outline how subtyping impacts the ergonomics of sum types in Scala.
Coming from Haskell and Python I found releasing a Scala library a cumbersome process. The standard Maven Central archive—JCenter claims to be a more popular alternative, but all big projects appear to prefer the former—lacks a convenient web interface like that of Python’s package index or Haskell’s Hackage, and comprehensive documentation about publishing. Getting an artifact to Maven Central for the first time involves a surprising number of manual steps and a rather elaborate SBT configuration.
In this article I hope to connect all the loose ends and offer a comprehensive step-by-step guide from nothing to a Maven Central release. I will start with some prerequisites which lie outside the scope of this article, guide you through the necessary bureaucracy and cover the setup. At the end I’ll introduce sbt-release, a powerful plugin to automate the entire release.
A lot of Emacs Lisp code uses interactive commands like
write-fileto read or write files. This article gives reasons not to follow this pattern, and shows safer alternatives with the f.el library and with built-in functions.
When reporting issues to Emacs packages you will often find maintainers replying with “Please reproduce this issue in
emacs -Q”. This article explains what this means, why maintainer may ask for this and how to use
emacs -Qto reproduce an issue.
Emacs offers some flags to use Emacs Lisp for standalone scripts, however Emacs’ decade-long history as an interactive program makes writing standalone scripts an intricate and subtle experience. This article starts with a discussion of the safe and correct Emacs Lisp shebang—which turns out to be much longer than you might expect. We then take a look at command line arguments and standard input and output of Emacs Lisp scripts, and finally conclude with some debugging tips and the recommendation to better use another language for your scripts.
Emacs offers an autoloading mechanism to load libraries on demand when calling functions. This article explains how to declare autoloads, how they work, and how Emacs Lisp packages use autoloads to improve startup time.
This article concludes my series about Font Locking in Emacs by illustrating how to hook into Emacs’ syntactic analyses to implement context-sensitive fontification. If you are new to this series, you may want to read the earlier articles on Syntactic Fontification in Emacs and Search-based fontification with keywords.
Use Haskell’s FFI interface to run Python code for fun and profit.