HN
Today

Rethinking Database Programming

Evan Czaplicki, creator of Elm, unveils Acadia, a novel approach to database programming designed to alleviate common developer frustrations. It tackles SQL's type safety, migration complexities, and end-to-end consistency with a functional-inspired language that compiles to optimized SQL. This public alpha promises a safer and more ergonomic database interaction for modern application development, drawing significant interest from the HN community.

22
Score
3
Comments
#2
Highest Rank
3h
on Front Page
First Seen
Aug 18, 9:00 AM
Last Seen
Aug 18, 11:00 AM
Rank Over Time
932

The Lowdown

Acadia is a new database programming tool introduced by Evan Czaplicki, known for creating the Elm language. It aims to modernize database interaction by applying principles from functional programming to address long-standing challenges with SQL, offering a more type-safe and developer-friendly experience. The tool is currently available in public alpha.

  • Precise Types: Acadia seeks to store custom types directly in the database, eliminating the need for manual conversion to binary, JSON, or nullable columns, which often leads to data precision loss.
  • Verified Migrations: It introduces compiler-verified migrations, aiming to remove the anxiety associated with SQL schema changes by ensuring correctness before deployment.
  • Friendly Error Messages: Drawing from Elm's success, Acadia prioritizes clear and helpful error messages for database queries.
  • End-to-End Type Safety: The system facilitates sharing types across client, server, and database, ensuring that changes in one layer propagate meaningful error messages throughout the stack.
  • Functional Querying: Users define tables and endpoints using functional constructs like map and filter, which Acadia compiles into high-quality SQL at compile time.
  • Complex Transactions: It supports intricate multi-step transactions using a bind syntax, similar to async/await, ensuring all steps succeed or fail atomically.
  • Backstory: The project originated from frustrations with type mismatches between client code and SQL databases experienced by Elm users, evolving from initial ideas around stored procedures to its current Elm-like design.
  • Current Status & Future: Acadia is in public alpha, with documentation and examples available. Future development will focus on preventing 1+N queries, handling migrations with old clients, and expanding features like window functions, guided by community feedback.

Czaplicki expresses renewed enthusiasm for this language work, inviting developers to experiment with Acadia, join the Discord community, and provide feedback to help shape its future development and feature prioritization.