- 25 Aug 2018 » You need a novelty budget
- 19 Aug 2018 » The ThinkPad: an elegant weapon
- 18 Mar 2018 » notes on a better migration system for Persistent
- 31 Dec 2017 » Resolutions, Plans and Systems
- 13 Jul 2017 » A Modest Scraping Proposal
- 18 May 2017 » a fallible guide to persistent-template
- 27 Apr 2017 » haskell profiling without pain
- 10 Mar 2017 » cabal flags for dev flow
- 27 Oct 2016 » Haskell Testing Desiderata
- 24 Oct 2016 » Fast tests and static languages
- 21 Jul 2016 » yolo oriented database programming
- 06 Apr 2015 » Paranoid Testing in Haskell
- 17 Feb 2015 » Typed Holes for beginners
- 05 Sep 2013 » iPad LCDs and filthy hacks
- 21 Jul 2013 » the unreasonable effectiveness of suffix trees
- 23 Jun 2013 » an iPad as an extra screen for Linux
- 03 May 2013 » guard for haskell/cabal/hspec projects
- 02 Feb 2013 » Roy Arthur Wilcox Wotton
We measure a lot of things in software engineering these days. Test coverage, time-to-deploy, bugs per line - they’re all good things to keep an eye on. They’re all proxies for risk of failure, either from moving too slowly, or from bugs and downtime destroying the business.
I like ThinkPads.
Problems with Persistent
Traditionally, the new year is when we all make public proclamations of how we’re going to be better humans: this year, we will read more, run more, listen more, eat healthier, and generally be our best selves.
Why scraping libraries in Haskell aren’t good enough
Template Haskell is often considered a smell in Haskell, responsible for everything from slow compile times to impenetrable error messages to the cow’s milk turning sour. Some of this is warranted, but if you need to check anything based on compile-time information, it is also the only game in town.
In general, stack is pretty good at caching build artifacts - the first build might be glacial, but incremental builds are snappy. This all goes out the window when you start playing with flags like –profile, though - stack sees that something has changed and dutifully rebuilds every-bloody-thing. This is a huge disincentive to casually run profiling builds.
It’s good practice to make sure your code is warning-free before committing or releasing. In the throes of editing, though, it can be extremely annoying to have to fix a swathe of trivial warnings when you really just want to see if things basically make sense (especially if you’re fond of undefined-driven development, and are using a prelude which marks undefined as deprecated).
I’ve been playing around a bit with a slightly different style of database code lately. Usually, I’d carefully check that a given insertion/update isn’t going to violate any parameters, then actually do it, all wrapped in the implicit surrounding transaction that Persistent gives you. It works, but it never feels quite right; what was the point of telling your database what the constraints were if you’re going to duplicate them anyway?
How we know our code does the right thing?
Typed holes are a feature GHC borrowed from Agda. They are incredibly useful for incremental development, making it really easy to go from correct (but incomplete) state to a more complete version.
A quick excuse to brag about a win:
When I’m home, I am surrounded by monitors. It is like returning to a Mission-Control-influenced womb. Still, while I am definitely a fan of being gently irradiated by millions of pixels, I am also a fan of travel, and there is a drastically limited number of 27” monitors that will fit into your average backpack. Hence, I’ve been thinking for a while about ways to use the lovely screen on my iPad as an extra terminal. I usually take it anyway, so it’s not even costing me extra luggage space.
I’ve recently moved most of my development work to Haskell, and in the main, it’s been extremely successful. High-concurrency work has been a breeze: the only difficulties I’ve hit have been to do with operating system limits, not Haskell’s.
I never agreed with my grandfather about anything, really. I was a stroppy little libertarian when I was younger, and a rabid atheist, which didn’t sit well with his muscular Christian socialism. We argued constantly: about communities, theism, technology, relationships. He was almost impossible to pin down on anything resembling a logical argument: every point would be met by an anecdote, every refutation by a quote from a Latin poet. To a mathematical, Apollonian mind, he was frustratingly Dionysian, and for a while, that blinded me to the deep humanity behind everything that he said.