David Rothlis

david.rothlis.net · Personal blog · on HN since 2011

David Rothlis, a software engineer, writes about Emacs, SQLite schema migrations, build systems and software testing.

What HN saysHN commenters recommend his Emacs tutorial, cite his declarative SQLite migration method for their own use, and link his Ninja build benchmarks.
19HN people shared it
14linked it in comments
11stories submitted
142story points
4 months agolast shared
2011people per year2026

Most-shared posts

  1. 1
    Simple declarative schema migration for SQLite
    7 people · 109 points · first shared 2022 · 28 comments on HN
  2. 2
    Benchmarking the Ninja Build System
    6 people · 1 points · first shared 2016 · discussion on HN
  3. 3
    How to learn Emacs
    2 people · 22 points · first shared 2012 · 7 comments on HN
  4. 4
    Ruby on Rails: An experience report
    2 people · 2 points · first shared 2012 · discussion on HN
  5. 5
    Distracting syntax highlighting
    2 people · 1 points · first shared 2012 · discussion on HN
  6. 6
    Characterisation tests
    2 people · first shared 2020
  7. 7
    Compilation model
    2 people · first shared 2012
  8. 8
    Tutorial
    2 people · first shared 2020
  9. 9
  10. 10
    Why Emacs
    1 people · 2 points · first shared 2012 · discussion on HN
  11. 11
    Helpful programming tools: Case studies
    1 people · 2 points · first shared 2011 · discussion on HN
  12. 12
    Writing a large build system with GNU make
    1 people · 1 points · first shared 2016 · discussion on HN
  13. 13
    Shell set e
    1 people · first shared 2022
  14. 14
    Customize c
    1 people · first shared 2012
  15. 15
    Basic c
    1 people · first shared 2012

What HN people wrote when they linked it

drothlis · 2022-01-20
Years ago I wrote the Emacs tutorial I wish had existed when I was learning Emacs: https://david.rothlis.net/emacs/tutorial.html It follows a similar philosophy as the OP: Start by reading Emacs's built-in tutorial, and then my tutorial shows you how to leverage the built-in help system to figure out how to achieve what you want to do.
dagmx · 2023-12-26
I should rephrase, by dependencies I mean third party dependencies. That is on the build system not the compiler. And make tends to fall significantly behind Ninja in my experience for cold builds. Here’s a post from someone else that echoes my experience https://david.rothlis.net/ninja-benchmark/ but for a sufficiently complex project even a well tuned make build is about 20% slower on CI, which is about 10-20m per build. It also seems like you’re giving make the benefit of the doubt when it comes to “most being badly written but my own is great”, while simultaneously deriding cmake without giving it the same benefit. But to your larger point, and going back to my C vs other languages comparison (let’s pick C++ for arguments sake). Yes Make can do it all, but even by your own statements it requires doing everything correctly and there’s significant room for error. CMake makes the trade off of abstraction for a more consistent experience with minimal work. This is similar to C and C++, where yes C can (1) do much better in the very very specific right hands, but (2) it can also become an unwieldy mess. C++ with RAII may seem perplexing from the lens of only accepting the former and not the latter. It lets people spend their time elsewhere on the system.
simonw · 2022-05-03
This is an interesting approach to this problem. I like the idea of building the new schema as an in-memory database. You could even go a step further and compare them using a SQL query that joins across the two databases (SQLite supports this, it's pretty neat). I'm a bit nervous about how edge-cases might screw things up, but a nice thing about SQLite is that backups are really cheap so I guess you can protect against any risks by creating a backup before running this script. My preferred approach to database migrations is the one implemented by Django: migrations are a sequence of transformations stored in files on disk, and the database includes a table that says which of those migrations have been applied. This keeps everything in version control and means there's no chance of the wrong migration being applied in the wrong way. It's quite a bit more work to setup though. I don't have my own Django-style migration system for SQLite yet and I really need one. I really love how clean and short the implementation of this is! https://david.rothlis.net/declarative-schema-migration-for-sqlite/migr…
NateEag · 2020-04-15
I'm a moderately experienced Emacser - been using it heavily since 2009 (first encountered it in 2003). I have written a few small extensions and contributed features and bug fixes to bigger ones. Credentials established, I cannot recommend this tutorial enough: https://david.rothlis.net/emacs/tutorial.html He walks you through most of the core of what makes Emacs great by showing you how to make a change to a project in the idiomatic Emacs way. I would have learned it years faster had I started there. Beyond that, learn basic Emacs keybindings via the tutorial, as others have suggested. I started in Emacs but installed evil-mode a few years ago and have never looked back. I do not recommend Spacemacs. Install the tools you want as you find you want them, so that you know what's doing what, and so you have a decent chance of knowing what broke things when something stops working. Keep your packages in version control as part of your .emacs.d repository. That keeps updates and deleted packages from screwing you. Use "use-package" (https://github.com/jwiegley/use-package) for configuring what you install. It's written by one of the Emacs maintainers and will help you do things right by default. I'm not the best Emacser out there, but if you're curious, my config is on my GitHub account: https://github.com/NateEag/.emacs.d Happy hacking.
wmanley · 2026-07-11
We use this for migrations: https://david.rothlis.net/declarative-schema-migration-for-sqlite/ Discussed here: https://news.ycombinator.com/item?id=31249823 But it would be a lot better if it were built in.
waynenilsen · 2026-02-05
This post from 2022 is the one I keep going back to https://david.rothlis.net/declarative-schema-migration-for-sqlite/
cztomsik · 2024-04-09
column reordering is simple to fix with this migration script https://david.rothlis.net/declarative-schema-migration-for-sqlite/ if you are using Zig (and like to live on the bleeding edge), you can also just use my library which includes similar script and also a simple query builder https://github.com/cztomsik/fridge?tab=readme-ov-file#migrations
evanelias · 2024-04-05
There are actually a bunch of external tools that offer declarative schema management flow. Personally I agree that that the overall flow should be external to the DB, but it would be useful if databases could offer more built-in functionality in this area to make these tools easier to write. For sqlite in particular, check out https://david.rothlis.net/declarative-schema-migration-for-sqlite/ and https://sqlite-utils.datasette.io/en/stable/python-api.html#transformi…
cldellow · 2023-02-16
BTW, for schema migrations, I've found the approach described here [1] to be pretty good! [1]: https://david.rothlis.net/declarative-schema-migration-for-sqlite/
kingosticks · 2020-10-27
The conclusion at https://david.rothlis.net/ninja-benchmark/ (2016) was that this doesn't have an impact until you get to really large projects (assuming you are able to utilise make -j).
isaachier · 2018-05-27
This benchmark would imply that isn't usually the case: http://david.rothlis.net/ninja-benchmark/.
bosky101 · 2012-10-06
enjoying reading http://david.rothlis.net/c/compilation_model/ will get in touch, when i'm done with ^
maccard · 2020-12-24
I wonder what the appeal of having the build tools written in JS is, as performance is key here. Spoilers on the article: > Rebuilding our seller tools, which previously took almost a minute on every request, now takes under 30 seconds when we’re starting a fresh compiler, and subsequent requests take only a second or two. According to [0], esbuild is orders of magnitude faster than we pack. The speedup advertised is from 60s to hundreds of ms. The article talks about 12k js files, while according to [1], 4 year old hardware could handle an out-of-date check in less than a second on the entire code base if using a tool like make. Im coming at this from an outside perspective, but even the results sound like they could be substantially faster? That said, it's an interesting article and I enjoyed reading it! [0] https://esbuild.github.io/. [1] https://david.rothlis.net/ninja-benchmark/
canadiantim · 2026-02-05
What do you think of the approach that pg_roll takes? Seems like the top contenders, at least for Postgres, are: sqldef: https://news.ycombinator.com/item?id=46845239 pgschema: https://github.com/pgschema/pgschema pg_roll: https://github.com/xataio/pgroll atlas: https://github.com/ariga/atlas grate (minimal SQL-based migrations): https://grate-devs.github.io/grate/ pg-schema-diff: https://github.com/stripe/pg-schema-diff results: https://github.com/djrobstep/results https://david.rothlis.net/declarative-schema-migration-for-sqlite/

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close