So I've been working on a #golang tool that will take in a JSON-LD RDF specification (like the #ActivityStreams one here :https://github.com/gobengo/activitystreams2-spec-scraped/blob/master/data/activitystreams-vocabulary/1528589057.json) and spit out generated Go code that automatically generates the static types for it.
The intent is, ActivityStreams extensions would be able to host this specification as their @context reference, people could use this tool to auto-generate the extension for their Go code, and then build their apps with it.
> I am big on avoiding the reflection penalty
I wonder if this penalty is as high as having to recompile/redeploy your application every time the target API decides to add a new property to its JSON-LD representation.
It sounds a bit too "enterprisey" to me.
@mariusor If a vocabulary adds a new property and the generated go code doesn't recognize it, it just treats it like any other unknown property and transparently preserves it (requirement of ActivityPub). The only reason to recompile and redeploy is to update the app code to do something with this new field, which would require a regenerate+recompile+redeploy anyway. Reflection doesn't buy anything unless the entire app server is basically written with the reflection package types.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!