google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.27k stars 204 forks source link

Port pytruth as lib/truth #361

Open fenollp opened 3 years ago

fenollp commented 3 years ago

Hi there, I've just finished porting https://github.com/google/pytruth to Starlark for use in https://github.com/FuzzyMonkeyCo/monkey which requires expressive assertions.

I understand these are the points that should require discussion (some/all are mentioned in the package docs):

Please share your thoughts and take some time to do a bit of reviewing :)

tetromino commented 3 years ago

There are 3 different Starlark implementations: this one in Go, the Java one built into Bazel, and the Rust one. And my immediate reaction to adding a major feature (a new module) to just the Go implementation would be negative.

Is it possible to write something good enough for your use case in pure Starlark and distribute it as a separate package that any Starlark interpreter can use?

If it's not possible, what is a minimal set of new interpreter features that you would need in order to be able to write it in pure Starlark?