DEV Community

Sunder
Sunder

Posted on

Introducing Go++

My dear fellow developers,

I’d like to take a moment of your time to announce that I’ve been working on an experimental project called Go++, a superset of Go that compiles to plain Go; the project is still in early stages and definitely not ready for production use but I was hoping to get some early feedback from the community that could help steer it in the right direction.

I love Go and its simplicity, but many a time I’ve wished it allowed me to express my intent a little more succinctly and Go++ is an attempt towards exactly that but while remaining firmly grounded to the Go runtime and its awesome and mature standard library and the ecosystem.

In a nutshell, Go++ currently offers things like:

  • Classes and polymorphism
  • Generics
  • Multiple inheritance
  • Function and method overloading
  • Named and default arguments
  • Enums and structural records
  • Extension methods
  • String interpolation
  • Safe nil walking and fallbacks
  • Exceptions
  • Annotations and introspection
  • and more!

One important project constraint driving the compiler has been to compile a Go project without any modifications thus letting developers incrementally adopt Go++ features as they see fit for the problem at hand.

The project has grown beyond the compiler itself and now includes a CLI, formatter, language server/VS Code extension, testing, and some opinionated built-in packages for HTTP routing, serialization, ORM and more.

Go developers can quickly try it with:

go install github.com/telgatech/gpp@main
gpp init hello
cd hello
gpp run
Enter fullscreen mode Exit fullscreen mode

Detailed documentation including getting started guide and sources available at:
https://gpp.telga.in/
https://gpp.telga.in/guide/getting-started
https://github.com/telgatech/gpp

I’d love feedback from Go developers who are willing to give it a spin—particularly around the language design, Go interoperability, tooling, rough edges, and anything that feels surprising or inconsistent.

If you try it, let me know what works, what breaks, and what you’d like to see next.

Top comments (0)