Project ideas from Hacker News discussions.

Turns are Better than Radians (2022)

📝 Discussion Summary (Click to expand)

Summary of the three most prevalent themes

Theme Core idea Supporting quotation
1. Units and dimensional analysis – The debate over whether angles should be treated as dimensionless or as quantities that carry a unit (degrees, radians, turns). “It's because both radians and degrees are a ratio of a length to another length and are thus dimensionless. No matter how you measure it, all angles are without a unit.” – math‑man
2. Function applicability and floating‑point equality – You cannot directly apply trigonometric (or other) functions to dimensional values; doing so raises issues with unit‑aware code and with comparing floating‑point results. “You generally can’t apply functions to dimensional units. The only thing units can do is be multiplied or divided together… you can’t take the sine of a distance or the logarithm of a time.” – jameshart
3. Practical use of alternative angle representations – Turns (or gradians) are convenient in some domains (games, signal processing, artillery) but introduce extra factors (e.g., 2π) that complicate calculus and derivatives. “Turns are very convenient until you need to calculate a rate of change, as of course d/dx sin(2π x) = 2π cos(2π x). Unfortunately this is a common enough problem that I will be sticking with the radian.” – traes

🚀 Project Ideas

Typed Angle DSL

Summary

  • Provides a domain-specific language with strong compile‑time typing for angle units (turns, degrees, radians) eliminating accidental unit mix‑ups.
  • Core value proposition: developers can safely use trig functions without manually inserting conversion factors.

Details

Key Value
Target Audience Front‑end and scientific JavaScript/TypeScript developers, data‑visualization engineers, and math‑heavy apps.
Core Feature Typed expressions that enforce correct unit usage for sin, cos, atan, etc.; automatic conversion between units; runtime validation fallback.
Tech Stack TypeScript + ts‑lib‑dart, Webpack/CRA integration, optional Node CLI, Jest tests.
Difficulty Medium
Monetization Revenue-ready: SaaS starter kits with premium unit packs and enterprise support.

Notes

  • HN commenters repeatedly lament mixing radians and degrees leads to bugs (“you have to keep track of extra terms”); this tool makes the mistake impossible.
  • Discussion potential: community could extend the DSL with additional unit types (angular velocity, phase), fueling a ecosystem similar to “measurement kits” discussed in the thread.

Angle Unit Aware Compiler Extension

Summary

  • A compiler plugin/add-on that annotates numeric literals with explicit angle units and injects conversion constants automatically, catching unit errors at compile time.
  • Core value proposition: removes the manual 2π/360 tracking burden highlighted by several commenters.

Details

Key Value
Target Audience Systems programmers, Rust/C/Go developers working with trig heavy code, and language designers interested in unit safety.
Core Feature Annotated literals (45°, 0.5turn) that the compiler validates; automatic conversion for function arguments; CI warnings when mixing units.
Tech Stack Clang/LLVM plugin or Rust proc‑macro, or TypeScript transformer, plus a small CLI for validation.
Difficulty High
Monetization Revenue-ready: Commercial licensing for IDE integrations and team‑wide codebase adoption kits.

Notes

  • Directly addresses “you have to keep track of extra terms like 2π/360” and the desire for compiler‑level unit checks; aligns with "we can’t just let the compiler optimize away pi factors" discussions.
  • Potential for wide adoption in scientific libraries; opens conversation about adding a formal unit system to mainstream languages.

Interactive Angle Unit Visualizer

Summary

  • A browser‑based REPL that visualizes angle representations (turns, degrees, radians) and their relationships, providing instant feedback when applying trig functions or calculus operations.
  • Core value proposition: helps developers intuitively grasp dimensionless aspects and the impact of unit choices, addressing confusion about “all angles are dimensionless”.

Details

Key Value
Target Audience Educators, students, and hobbyist programmers exploring trigonometry or debugging unit errors.
Core Feature Live graph of sine/cosine curves with selectable angle unit; automatic dimension analysis warnings; export of unit‑safe code snippets.
Tech Stack React + D3.js for graphics, WebAssembly for fast math, bundled as a static site on GitHub Pages.
Difficulty Low
Monetization Hobby

Notes

  • Directly mirrors HN users’ curiosity about “why radians are natural” and “dimensionless arguments”; a visual tool would satisfy many ask‑for‑examples (“Where can I see code?”) requests.
  • Sparks community discussion, potential for contributing extra unit modules, and could evolve into a learning resource referenced in future posts.

Read Later