Introducing Go++ — a superset of Go

Hi all!

I’m terrified but wanted to share nonetheless that I’ve been working on an experiment called Go++, a superset of Go that compiles to ordinary 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 over the years I’ve occasionally wished I could use some features that Go quite deliberately avoids. Go++ is my experiment in layering some of those capabilities on top while retaining Go interoperability and the existing Go ecosystem.

Go++ currently adds 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!

The important constraint is that Go++ compiles to ordinary Go. The intention is to retain interoperability with Go packages and the existing Go ecosystem rather than create an entirely separate runtime/world.

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

You can try it with:

go install github.com/telgatech/gpp@latest
gpp init hello
cd hello
gpp run

Source, examples and documentation: GitHub - telgatech/gpp: Go++ Programming Language. A practical superset of Go with classes, exceptions, enums, and more—compiled to ordinary Go. · GitHub

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.

I’m my opinion this is simply too much. There are some interesting solutions I would probably try, if I could use them in a small and isolated package - but this is a giant collection of very different things.

What you created there should be split into at least 3 isolated projects, which can be used together gut your vision, but which can be vetted, validated and used standalone.

I am using go for critical applications and one of the main reasonsI use go is the unparalleled stability and safety of the language and the standard library. When you provide something which wants to work on par with either of those, you will need to provide easily accessible proof that your solution is as rock solid and battle hardened as the foundation. And you simply cannot provide this as a single person for such a massive set of features.

1 Like

Ha, yes. I know what you mean, feels like a lot to drop it all at once. And no, I certainly don’t call this production quality at the moment but I hope the community would join me in making it so. That said, thankfully these features seem to have converged rather well going by how well it’s shaping up. I hope you get to try it sometime and share your feedback! Thanks again!

Honestly tired of seeing all these. I don’t think they even fit in Go language environment. that’s like JAVA. I don’t think any gopher wants that. gophers are happy with go itself.

1 Like

What i feel in love with go it is its simplicity. However, there are some good ideas here that can be useful for going further and even simplifying things more. For example, extensions, ORM (right-in-the-box) and other features.

@Yamil_Bracho Appreciate your feedback, I’m glad you found something useful here. My aim here was to give us Go developers more higher level tools to help build better solutions with fewer lines of code using well understood software patterns while staying true to the Go ecosystem and the learning invested. For me personally, exception handling alone has been worth its weight in gold! :slight_smile: Hope to hear your experiences should you try this out in the future. Thanks!

@Sunder Let me check the excpetion handling. I am just learning V because it offers the Option/Result pattern to handle exception so it would be great to check another point of view…

1 Like