news.volyx.in

Borgo is a statically typed language that compiles to Go (github.com)

666 points by manx · 836 days ago · 545 comments on HN

Article summary

Borgo is a new programming language that transpiles to Go, aiming to provide a more expressive and type-safe alternative to Go. It features algebraic data types, pattern matching, and error handling with the ? operator. Borgo is written in Rust and can be compiled to Go code, which can then be run as normal. The language is designed to be compatible with existing Go packages.

Main themes

  • Programming languages
  • Transpilation
  • Type safety
  • Language design
  • Compiler technology

What commenters say

  • The terms 'compiler' and 'transpiler' are often used interchangeably, but some argue that a transpiler emits code intended for humans to understand, while a compiler does not.
  • The distinction between compilation and transpilation is not well-defined and may be unnecessary, as both involve translating code from one language to another.
  • A transpiler is typically seen as a tool that translates code from one high-level language to another, whereas a compiler translates code to machine code.
  • The output of a transpiler is often intended to be read and understood by humans, whereas the output of a compiler is typically not.
  • The term 'transpiler' implies a specific set of characteristics, such as operating on the AST and not performing optimizations, that distinguish it from a compiler.
  • The distinction between compilation and transpilation may be based on the level of optimization performed, with compilers typically performing more extensive optimizations.
  • The use of the term 'transpiler' may be more a matter of convention and historical context than a reflection of any fundamental difference in the technology.
  • The discussion around the terms 'compiler' and 'transpiler' highlights the complexity and nuance of programming language technology and the need for clear definitions and distinctions.