cgscript
By maksimil
truthy
Package truthy provides truthy condition testing with Go generics (by earthboundkid)
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.
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.
cgscript
Posts with mentions or reviews of cgscript.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-10-27.
-
A fast golang script runner
The thing that annoys me about golang is startup time. Sure, it's fast, but when I write my scripts `go run` compiles the script for half a second just for it to run for literally 7ms. It annoyed me, and I've created cgscript which caches the compiled executable that `go build` produces so that you won't have to recompile your scripts every time you run them.
-
What annoys you about Go?
I love using go for scripting, but `go run` builds my script for like half a second just for it to run for literally 7ms every time. So I've created cgscript which caches go executables so that go doesn't have to recompile them again and again. Sorry for the shameless plug.
truthy
Posts with mentions or reviews of truthy.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-06-24.
-
What are your strategies to prevent nil pointers errors in your code base?
I personally always make sure that, if I have a function that creates the struct, I define all of the fields. When I don't a) have control over that or b) have a function to init the struct, I typically end up using a new package called truthy that is built on generics and tells me the truthy value of the variable, kind of like Boolean(value) in javascript.
-
What annoys you about Go?
They didn't have a ternary. ;-)
- Fun with Go generics: a package to add truthy conditionals
- Using generics to create truthy condition testing helpers
- truthy condition testing using Go generics
-
Three Things Go Needs Right Now More Than Generics
If you have generics, you don’t need ? because you can write truthy.Cond(cond, ifVal, elseVal) instead.
What are some alternatives?
When comparing cgscript and truthy you can also consider the following projects:
yaegi - Yaegi is Another Elegant Go Interpreter
gojq - JSON query in Golang
go-cmp - Package for comparing Go values in tests
JSON-to-Go - Translates JSON into a Go type in your browser instantly (original)
windigo - Windows API and GUI in idiomatic Go.
gofuzz - Fuzz testing for go.