Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've got about 70% of a capnproto implementation written in pure javascript that works in the browser.

Part of the problem is that there is a bit of an ideological difference, where I prefer dynamic code to adding build steps but all the existing tools and code assume you want to generate source. I also found it quite irritating to bootstrap too, because the tooling itself uses capnproto. It sounds neat, but then it means that you have to be able to read capnproto in order to be able to read it.

The documentation was also incredibly patchy at the time which made it quite hard to develop for, although I'm told that the kentonv & gang are very helpful.

In the end, I was just starting to struggle with capnproto generics when my requirement went away as the server I was connecting to added a msgpack option.



FWIW, the Python implementation of Cap'n Proto loads schemas dynamically -- there is no code generator.

However, this is done through a C extension that calls into the C++ implementation. For browser-side Javascript, that's obviously problematic. (Emscripten isn't really the answer -- would be way too large a download.)


> Emscripten isn't really the answer -- would be way too large a download.

Could the emscripten result be slimmed-down?

(I fear the answer is probably “in theory, yes, in practice, it's >100KB”)


Do you happen to have a repository for this on Github?


It's still very much in a sketch/exploration state (looking at it again, 70% is pretty optimistic :-) so it's unlikely to be much use to anyone who hasn't spent a bunch of time trying to implement it themselves, but if you think there's a chance it might help you then send me your contact details (my email is in my profile) and I'll send it to you.




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

Search: