tree: 4bf74913a82d75695a3b742b3a50626ddc984910 [path history] [tgz]
  1. as3/
  2. c_glib/
  3. cl/
  4. cpp/
  5. csharp/
  6. d/
  7. dart/
  8. delphi/
  9. erl/
  10. go/
  11. haxe/
  12. hs/
  13. java/
  14. js/
  15. netcore/
  16. nodejs/
  17. ocaml/
  18. perl/
  19. php/
  20. py/
  21. py.tornado/
  22. py.twisted/
  23. rb/
  24. rs/
  27. shared.thrift
  28. tutorial.thrift

Thrift Tutorial


Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


  1. First things first, you'll need to install the Thrift compiler and the language libraries. Do that using the instructions in the top level file.

  2. Read tutorial.thrift to learn about the syntax of a Thrift file

  3. Compile the code for the language of your choice:

    $ thrift $ thrift -r --gen cpp tutorial.thrift

  4. Take a look at the generated code.

  5. Look in the language directories for sample client/server code.

  6. That's about it for now. This tutorial is intentionally brief. It should be just enough to get you started and ready to build your own project.