functional-go
genny
Our great sponsors
functional-go | genny | |
---|---|---|
4 | 6 | |
179 | 1,690 | |
- | 0.0% | |
5.9 | 0.0 | |
5 months ago | over 2 years ago | |
Go | Go | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
functional-go
- functional-go/internal/generatefp.go
-
Go 1.18 Released
>> By introducing a single generic, you could reduce it from 500 lines to 20
No one is writing 500 lines of code - just as when you use the generics syntax you don’t write the code that is generated by the compiler in response.
You could save about 10 lines, specifically these 10:
https://github.com/logic-building/functional-go/blob/master/...
You would still need the comparable ~40 lines of “generic” code:
https://github.com/logic-building/functional-go/blob/master/...
-
Do you see any interesting use cases for the upcoming type sets, other than generic type constraints?
Yes! There is this library that uses go generate for achieving functional patterns https://github.com/logic-building/functional-go. It would really benefit from such thing.
genny
-
Go 1.18 Released
Im not sure about any library in particular.
There were bunch of libraries which helped with code generation to work around generics. I don't think it was specific to Graphql.
https://github.com/cheekybits/genny is one I have seen.
-
To Those Who Criticize JavaScript
TypeScript is pretty much necessary for a modern JS project if you ask me, so I agree with you here. At the same time, I'd say that if the JS ecosystem offers a solution, that doesn't count as a failure. It's like pointing to the lack of generics in Go and calling that a failure. No, that's a design choice that can be worked around. Same in JS; dynamic typing was a design choice, TypeScript is a solution.
-
Learn to build SDK or Wrapper over REST and Websocker
If you want to experiment, I've been meaning to try out this library, which uses code generation (a first-class feature in go), to give generics-like functionality.
-
Created my first go tool, an interface generator
If you are into codegen, there are some larger codegen projects or there, like cheekybits/codegen (there are more in the space of trying to circumvent generics in go).
-
Metaprogramming
In golang there is no parametric polymorphism (or “type parameters”, or “generics”). So people created workarounds, for example, gengen (similar solutions genny, generic, gen):
What are some alternatives?
lo - 💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)
goreuse
proposal - Go Project Design Documents
TOML-to-Go - Translates TOML into a Go type in your browser instantly
fp-go - fp-go is a collection of Functional Programming helpers powered by Golang 1.18+ generics.
gonerics - Generics for go
gtl - Golang Template Library (GTL). Common data structures using Golang generics.
xgen - XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator
go_chainable - With generics, allowing chainable .Map(func(...)).Reduce(func(...)) syntax in go
generic - flexible data type for Go
redpanda - Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!
Garment - 🐺 A Thread Safe Connection Pooling.