May 31, 2018

Why you should invest in an editor

Emacs 26.1 was released this week and I thought I’d use the occasion to write a quick post about the main reason why I stick to Emacs: consistency. Happily, I realized that this reason applies to other text editors as well. I use Emacs for programming; whether it’s Rust, C, Erlang, Python, or bash scripts, Emacs is the editor I choose. For any language I use, I have syntax highlighting and automatic indentation, and depending on the major mode, I can get other cool features such as jump-to-def, auto-completion, or REPL integration. ... Read more

May 27, 2018

What's next for ppbert?

ppbert has improved since the last time I wrote about it: I’ve done more work to improve the speed of pretty-printing; the large .bert file that took 3 seconds to process in Februrary now takes 1.5 seconds. I’ve added binary artifacts to releases — binaries for ppbert and bert-convert that are statically-linked against musl. You should be able to download these and run them on any 64-bit Linux system. (I inspired myself heavily from the work of my former co-worker, Sevag. ... Read more

February 9, 2018

Reflecting on ppbert

I had an itch: I was pretty-printing the BERT-encoded terms that we use in a production system at work and it was very slow. The Erlang shell took more than two minutes to dump the largest file. (It took about 0.1 second to read and parse the file; the rest was spent in io:format.) I decided to scratch that itch: I wrote ppbert, a command-line utility that reads BERT-encoded values and pretty-prints them. ... Read more

January 2, 2018

Quick reflection on first good Dwarf Fortress

I just retired my first good, semi-successful fort in Dwarf Fortress. I decided jot down a few comments while the memories are still fresh. My fort, Commonbread, lasted 6+ years, survived 4 goblin sieges, had 150 dwarfs at its peak, and generated more than ☼1.6M in value. Main mistakes My two principal mistakes are related: I picked a cold embark location, and I opened my gates to fight a goblin siege during late-autumn. ... Read more

November 29, 2017

Dwarf Fortress and ivy-mode

A new version of Dwarf Fortress was released last week, and it was all the incentive I needed to start playing again. I suck at DF, but I love that game: it savantly combines depth and complete wackiness and the old-school look-and-feel certainly appeals to me. Yet, I think that the game has (at least) one huge flaw: its menu system makes ed(1) look positively user-friendly by comparison. There are a lot of tasks that one can perform in Dwarf Fortress: select regions to be dug, build all kinds of shops and accessories, manage a militia, etc. ... Read more

September 13, 2017

What is a Type Error?

The top comment by /u/staticassert in a Reddit thread on type systems makes an interesting point, one that I made in the past myself: what is a type error? I read those types (pun intended) of threads often enough, and one recurring argument often made by people who doubt the benefits of type systems goes like this: “I rarely make errors that the type checker would catch; my bugs are logic in nature. ... Read more

September 6, 2017

A Simple Tip to Improve Rust Program Speed

I am on vacation this week, so I decided to dig out a backtracking Sudoku solver I wrote last summer and see what I could do to improve its performance. A couple of changes to the data structures and the algorithm yieled an important speed-up. Previously, I had used a BTreeSet to store the list of candidates for a cell; I now use a u32 to represent a set of 9 elements. ... Read more

September 3, 2017

My Review of The Talos Principle

Now that I have a slightly more powerful computer, I was finally able to play through The Talos Principle and its DLC, The Road to Gehenna. [Spoilers below] The gameplay is mostly about solving problems by using some items. You have jammers that can open doors, disable bombs and guns; boxes to hold down buttons and to increase the height of an item; connectors that relay a signal from an emitter to receivers and can open doors; fans to elevate yourself or an object; etc. ... Read more

August 7, 2017

Speedrunning a Compiler

At AdGear, the developers typically end their week at “Friday Not Friday”, a team activity from 4pm to 5pm. One person gives a presentation on any technical subject while the others listen and sip a beer to wind down before the week-end. Last week, I gave a demonstration that I called “Speedrunning a Compiler”. I wanted to show my colleagues the basics of writing a compiler, and I thought it would be more instructive if they saw code rather than an abstract flowchart. ... Read more

April 17, 2017

Less intrusive color theme

The purpose of syntax highlighting is to draw attention to certain parts of the code: it helps us to identify when a comment or a string literal is not properly terminated, when a keyword is misspelled, or when an escape sequence is invalid. Lately, I find that editors colorize too many elements and use too many colors. (This is a recently-acquired annoyance; maybe age and worse eyesight have something to do with it? ... Read more