News for hackers. Stuff that matters.
Re:Show HN: WebRPC – a simple alternative to REST and SOAP by malandrew on Wednesday October 21, 2015 @09:08PM (#10429890)
IDLs are awesomely useful and you can build all sorts of things on that abstraction, especially if you have a parser that produces a standard AST (I wrote a PegJS parser that takes the Thrift IDLs and creates a plain old javascript object AST that can be used for things like: (1) writing dynamic serializers/deserializers for binary data (uber/thriftrw), (2) validators (not yet written, but will both lint as well as check for backwards compatibility when IDLs are updated); (3) bash autocompletion for an RPC api via a curl-like command (soon to land in uber/tcurl))

At Uber, we started with Apache Thrift, but found many things about it limited and broken with dubious code quality for some languages. Furthermore we had more ambitious ideas like application layer sharding (uber/ringpop) and service discovery and routing (uber/hyperbahn).

We're still using the thrift protocols (uber/thriftrw) with our rpc library (uber/tchannel), but could have built on top of another IDL format like protobufs (v3).

For those curious about the RPC interface, just check out: https://tchannel.readthedocs.org/en/latest/

The interface supports all sorts of things

This is all over TCP right now and designed for performance and service to service communication, but there is nothing preventing the addition of HTTP (via XHR or WebSockets) as a transport for allowing web apps to speak with tchannel services. I contributed to the Apache Thrift implementation that allows this (https://github.com/apache/thrift/blob/master/lib/nodejs/lib/...). The implementation for tchannel would be similar, but rely on XHR/WS in the browser and the `http` module instead of the `net` module in NodeJS on the server. It's trivial to write a proxy frontend that relays TJSONProtocol on the frontend to a Thrift binary protocol like TBinaryProtocol or TCompactProtocol.

https://github.com/uber/hyperbahn https://github.com/uber/tchannel https://github.com/uber/ringpop-node https://github.com/uber/ringpop-go https://github.com/uber/idl https://github.com/uber/tcurl https://github.com/uber/tcap

etc.

Re:Show HN: WebRPC – a simple alternative to REST and SOAP by gk_brown on Thursday October 22, 2015 @08:52AM (#10431881)
That sounds cool. WebRPC isn't meant to be an "everything to everyone" solution. It's main advantage is simplicity and low overhead. It allows you to quickly and easily build a service tier that is consumable by multiple clients. But if your requirements scale beyond what WebRPC provides, Thrift sounds like a great option.
Re:Show HN: WebRPC – a simple alternative to REST and SOAP by stephenr on Saturday October 24, 2015 @01:29AM (#10442565)
Thrift is such a broken mess I willingly opted instead to fork and update a Java project that exposes xml over http.

Thrift must have been written by people who though SOAP was too easy to use and that developer lives should be made harder.

Re:Show HN: WebRPC – a simple alternative to REST and SOAP by malandrew on Monday October 26, 2015 @03:26PM (#10453784)
Completely agree that the thrift stuff is a mess, which is why we only used the one interesting part, the IDL, for our system. These days, proto3 would be viable, but wasn't feature rich enough at the time for our needs when we were evaluating options.