hn.today

Show HN: A modern take on the Go language

github.com7 points3 comments
Screenshot of Show HN: A modern take on the Go language

GPP is an independent language project that extends Go with features often found in higher-level object-oriented and application languages, while retaining Go packages, generated Go code, and the familiar build toolchain. Its additions include classes, inheritance and polymorphism, generic classes and functions, overloaded functions, named arguments and defaults, enums, extension methods, annotations, string interpolation, safe access, and exception-style syntax layered over Go error values. It also offers concise lambdas and helpers, plus serialization support that can generate JSON, YAML, and GOB conversions from model metadata.

The project goes beyond syntax with libraries and workflows for HTTP routing and request binding, OpenAPI documentation, typed SQL, ORM models, templates, embedded assets, cron jobs, and suite-based tests. A compiler translates GPP into Go, allowing GPP and ordinary Go code to call each other in mixed projects. The `gpp` command handles project setup, compilation, builds, tests, formatting, documentation, and editor language-server features; a VS Code extension adds syntax support and navigation. Trying it requires Go 1.27 or newer, and generated Go files normally remain in a hidden compiler workspace. The repository presents a broad, integrated alternative for Go developers who want more language conveniences without giving up Go interoperability, though its distinctive compiler and libraries make it a separate, independent project rather than an official Go extension.

Read on github.com3 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.