Hacker News new | past | comments | ask | show | jobs | submit login

I've had a go at doing it in Go and the ActivityPub spec is so loosely defined that it's just a real challenge if you intend to actually unmarshal the JSON you receive

It's not completely impossible but you have to be okay with discarding a lot of unknown options or essentially reverse engineering the objects used by the servers you are federated with

That's not to say it's impossible, I was able to crawl the network successfully, but it hints at the reason that Mastodon and Pleroma use dynamic languages

I'd be very interested to see a flexible/complete AP implementation in any statically typed language

Fwiw WriteFreely is implemented in Go with go-fed but -- correct me if I'm wrong -- that library seemed more limited to me than what Pleroma and Mastodon support




I'm surprised you didn't find my library because I managed to create a statically typed vocabulary library for Go that maps the specification verbatim: https://pkg.go.dev/github.com/go-ap/activitypub#Object

It wasn't easy indeed, and it locked me out of some options to support execution time vocabulary extensions, but hey, it works and it's relatively easy to use.


I'm surprised I didn't find it, too! My google-fu must be getting rusty. Thanks for the link, I'll have to have a deep dive when I get the time :)


I hope you get to it. The library itself contains more than just the vocabulary part and I would be glad of more eyeballs on the problem. :D


Here's the implementation described in OP: https://github.com/Gopiandcode/ocamlot

OCaml is a statically-typed language. It falls somewhere between Go and Haskell on the spectrum of type 'strength'.


> I'd be very interested to see a flexible/complete AP implementation in any statically typed language

Try Honk[1] or GotoSocial[2]?

[1] https://humungus.tedunangst.com/r/honk [2] https://github.com/superseriousbusiness/gotosocial


Neither is flexible, nor strives for completion. They are both implementations that try to map the ActivityPub vocabulary on an existing web-application domain.

They are not ActivityPub servers, but web-apps that use the ActivityPub vocabulary to federate, which is what I meant in the grandparent post when I mentioned the classic mistake of ActivityPub implementers. :D




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: