Project ideas from Hacker News discussions.

The compiler is your best friend

📝 Discussion Summary (Click to expand)

Here are the four most prevalent themes from the Hacker News discussion, supported by direct quotes.

1. Unreachable Code Paths Should Trigger Crashes

Many commenters argued that when an impossible state is reached, the safest action is to crash immediately. Continuing to execute code in an invalid state is seen as dangerous, as it can lead to silent data corruption or security vulnerabilities.

"At some level, the simplest thing to do is to give up and crash if things are no longer sane." — LegionMammal978

"Better to lose the last few hours of the user's work than corrupt their save permanently." — lmm

2. Assertion Failure Should Not Be Ignored

Participants generally favored using assertions (such as assert(false) or Rust's unreachable!()) over comments to document "unreachable" code. They argued that assertions provide defined behavior and documentation, whereas comments are easily outdated and ignored.

"It really depends on the language you use. Personally I like the way rust does this: ... unreachable!() (panics)." — josephg

"But at least telling people that the programmer believed this could never happen short-circuits their investigation considerably." — tialaramex

3. Type Systems Should Make Invalid States Unrepresentable

There was a strong consensus that modern type systems are the best tool for eliminating the need for these assumptions in the first place. Instead of writing defensive checks or comments, users argued for defining data structures that make it impossible for invalid data to exist at compile time.

"Ideally, if you can convince yourself something cannot happen, you can also convince the compiler, and get rid of the branch entirely by expressing the predicate as part of the type." — thatoneengineer

"Programmers in C-family languages waste most of their time working around the absence of sum types, they just don't realise that that's what they're doing." — lmm

4. The "Functional Core, Imperative Shell" Architecture

Several users suggested structuring applications to separate pure business logic from side effects (I/O). By pushing impure operations to the "shell" and keeping the "core" pure and deterministic, they argued code becomes easier to reason about, test, and maintain.

"A common pattern would be to separate pure business logic from data fetching/writing. So instead of intertwining database calls with computation, you split into three separate phases: fetch, compute, store." — supermdguy

"You wouldn't do it to make it easier to test; you would do it to make it easier to reason about." — grayhatter


🚀 Project Ideas

FuzzSpec Inspector

Summary

  • A tool for implementing the "Functional Core, Imperative Shell" pattern by generating fuzz-testing suites from business logic specifications.
  • It helps developers extract pure logic from "messy" procedural code by providing a framework to define invariants that are then automatically stress-tested with randomized inputs (as suggested in the discussion).

Details

Key Value
Target Audience Software Architects & QA Engineers
Core Feature Property-based testing generator & Invariant checker
Tech Stack Python (Logic DSL), Hypothesis (Fuzzing engine), WASM (Cross-lang support)
Difficulty High
Monetization Revenue-ready: Tiered subscription for CI/CD integration

Notes

  • This directly addresses the pain points shared by supermdguy and rmunn regarding the difficulty of separating effects from logic and the need for randomized testing to find "bitflip-style" or edge-case bugs.
  • Users like josephg emphasized: "Make a list of invariants... Make a check() function... If I had a penny for every bug I’ve found doing this, I’d be a rich man."

SQL View-Navigator

Summary

  • A development environment plugin (IDE extension) for managing "stacked SQL views" used as a purely functional business logic layer.
  • It visualizes the hierarchy of data transformations, allowing developers to treat their RDBMS as a transparent, side-effect-free computing engine without the "complexity bloat" of modern application layers.

Details

Key Value
Target Audience Data-heavy backend developers & Database Engineers
Core Feature Visual DAG of view dependencies & real-time performance impact analysis
Tech Stack TypeScript (VS Code extension), Postgres/DuckDB Lexers
Difficulty Medium
Monetization Hobby (Open Source) / Revenue-ready: Enterprise features (Team permissions)

Notes

  • Inspired by user bambax who uses SQL views to compute logic entirely in the DB: "Stacked views are... purely functional, have no side-effects whatsoever and cannot break."
  • This solves the "bloat" and "complexity" complaints raised by shevy-java, providing a way to perform "compute-fetch-store" patterns using existing, stable database technologies rather than adding new programming language dependencies.

Read Later