3 ms·
If you use Java with Thrift, you should check out Swift: https://github.com/facebook/swift https://github.com/facebook/swift Swift is an annotation-based libr
by electrum 14y ago
If you use Java with Thrift, you should check out Swift:
https://github.com/facebook/swift https://github.com/facebook/swift
Swift is an annotation-based library for creating Thrift types and services. It was created to be an alternative to code generation, which is generally a pain for Java development. Swift generates bytecode at runtime, so you get all the performance advantages of code generation with none of the development disadvantages.
The idea with Swift is that you own the annotated classes and can fully customize them to your liking, independent of the IDL and wire format. For example, you can name the methods whatever you want, add documentation, helper methods, etc. When implementing a client for Thrift service, you only need the methods that you actually call.
You can use swift-generator-cli to generate the initial versions of the classes from existing Thrift IDL, which you then customize and maintain yourself. Alternatively, you can use swift-maven-plugin, which is pure Java (no external C++ binary), to generate code at compile time.
This project is in active development and use at Facebook, so please give it a try and let us know what you think!