Live data from Hacker News

Apache Thrift Library

thrift.apache.org

1–10 of 13 posts

Re: Apache Thrift Library

#2
This looks like it could solve a lot of problems. I will look into this in greater detail later; I would like to see whether this can be used as a web service.

If I can write my web service in C++ and call it in Javascript, that would be amazing.

Re: Apache Thrift Library

#3

This looks like it could solve a lot of problems. I will look into this in greater detail later; I would like to see whether this can be used as a web service. If I can write my web service in C++ and call it in Javascript, that would be amazing.

Not to take away from thrift in any way but could you not do this already using any portable serialisation method? Json has c++ and JavaScript (de)serialisation implementations as does XML. Combined with a Rest-ful web service api surely it doesn't matter what the transport mechanism is?

Re: Apache Thrift Library

#5
post #4

Is this another protocol buffer implementation, or am I misunderstanding that?

Actually, it's from the same guy who implemented protocol buffers when he was at google. He re-implemented a better protocol buffers for facebook and chose to call it Thrift.

Re: Apache Thrift Library

#6

This looks like it could solve a lot of problems. I will look into this in greater detail later; I would like to see whether this can be used as a web service. If I can write my web service in C++ and call it in Javascript, that would be amazing.

Well, Thrift is an RPC mechanism; while it can use an HTTP transport, I'd say it makes more sense to use raw TCP streams to call it.

If you want to develop a web service in C++, you could check out the available web frameworks, like OKWS[1], CppCMS[2] or TreeFrog[3].

[1]: http://okws.org/doku.php?id=okws [2]: http://cppcms.sourceforge.net/wikipp/en/page/main [3]: http://www.treefrogframework.org/

Re: Apache Thrift Library

#7
post #3

This looks like it could solve a lot of problems. I will look into this in greater detail later; I would like to see whether this can be used as a web service. If I can write my web service in C++ and call it in Javascript, that would be amazing.

Not to take away from thrift in any way but could you not do this already using any portable serialisation method? Json has c++ and JavaScript (de)serialisation implementations as does XML. Combined with a Rest-ful web service api surely it doesn't matter what the transport mechanism is?

I guess their focus was on speed. XML is pretty slow and verbose, and whilst JSON is better, it's not the best solution. MongoDB's BSON is quite cool though.

Web Services and the associated HTTP headers are relatively slow, but browsers can make them, so are kind of necessary.

Re: Apache Thrift Library

#8
post #3

This looks like it could solve a lot of problems. I will look into this in greater detail later; I would like to see whether this can be used as a web service. If I can write my web service in C++ and call it in Javascript, that would be amazing.

Not to take away from thrift in any way but could you not do this already using any portable serialisation method? Json has c++ and JavaScript (de)serialisation implementations as does XML. Combined with a Rest-ful web service api surely it doesn't matter what the transport mechanism is?

JSON does not work well for binary data. BJSON tries to fix this, but in languages like C++ you will still have to deal with clumsy parser syntax when you deserialize your stuff. It's much more convenient to have native classes representing protocol objects in your language (protocol compiler generates them for you).

Re: Apache Thrift Library

#9
Evernote uses Thrift. It makes sense to use it or something similar over a plain-text format if you control the server and the client and send a lot of data back and forth. Evernote has gone farther than that, though, providing a public API for it:

http://www.evernote.com/about/developer/api/ref/

Re: Apache Thrift Library

#10
post #5
post #4

Is this another protocol buffer implementation, or am I misunderstanding that?

Actually, it's from the same guy who implemented protocol buffers when he was at google. He re-implemented a better protocol buffers for facebook and chose to call it Thrift.

I wouldn't say that Thrift is clearly better then Protobuf. It's more like they solve slightly different problems and make slightly different tradeoffs.
Post reply on HN