hn.today

Sift: The Lisp formatter I kept trying to write (+lint and LSP)

jointhefreeworld.org34 points37 comments
Screenshot of Sift: The Lisp formatter I kept trying to write (+lint and LSP)

Sift is a single Guile-based formatter, linter, and language server for Scheme, Racket, Emacs Lisp, and Common Lisp. It aims to replace the scattered editor settings, compiler warnings, dialect-specific scripts, and CI checks that often leave Lisp projects with inconsistent styles and no shared way to report or fix problems. Its central claim is that reliable tooling must understand source as structured code, not treat it as text: Sift parses files while retaining comments and source positions, so it can make targeted edits and report findings in formats usable by editors and automated checks. It includes more than 95 lint rules, supports command-line, editor, CI, container, and browser use, and produces the same results across those settings.

The design grew out of failed attempts using text scripts, Emacs indentation, Guix’s formatter, compiler checks, and a structure-driven pretty-printer. Those approaches either lacked context, depended on local configuration, could not report or fix issues consistently, or rewrote so much layout that diffs obscured meaningful changes. Sift instead makes formatting idempotent and limits itself to layout changes, preserving code structure and avoiding aggressive line reflow. Dialects are identified explicitly rather than guessed, and the language server declines unsupported requests rather than inventing answers. The tool offers formatting, linting, fixes, patch checks, CI runs, configuration inspection, and editor integration. After performance improvements, linting a repository reportedly fell from 25 seconds to under one, while memory allocation dropped from 1.5 GB to 140 MB.

Read on jointhefreeworld.org37 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.