Story Details

  • Ask HN: A retrofitted C dialect?

    Posted: 2025-02-22 08:11:45

    The author seeks a C-like language with modern features like generics, modules, and memory safety, while maintaining C's performance and close-to-the-metal nature. They desire a language suitable for systems programming, potentially as a replacement for C in performance-critical applications, but with the added benefits of contemporary language design. They are exploring if such a language already exists or whether retrofitting C would be a more viable approach. Essentially, they want the power and control of C without its inherent pitfalls and limitations.

    Summary of Comments ( 16 )
    https://news.ycombinator.com/item?id=43137171

    The Hacker News comments discuss the practicality and potential benefits of a "retrofitted" C dialect, primarily focusing on memory safety. Some suggest exploring existing options like Zig, Rust, or Odin, which already address many of C's shortcomings. Others express skepticism about the feasibility of such a project, citing the complexity of C's ecosystem and the difficulty of maintaining compatibility while introducing significant changes. A few commenters propose specific improvements, such as optional garbage collection or stricter type checking, but acknowledge the challenges in implementation and adoption. There's a general agreement that memory safety is crucial, but opinions diverge on whether a new dialect or focusing on tooling and better practices within existing C is the best approach. Some also discuss the potential benefits for embedded systems, where C remains dominant.