protoc-gen-haxe - Protocol Buffers compiler and run-time library for Haxe

  •        0

I am also the author of [protoc-gen-as3](,which is the best Protocol Buffers implementation in ActionScript 3.I rewritten these code because I want to try the Haxe way to generate code.This table lists main difference between `protoc-gen-as` (or any other Protocol Buffers implementation) and `protoc-gen-haxe`:| | protoc-gen-as3 | protoc-gen-haxe || ------------- | ------------- | ----- || Cross-platform | No. It only runs in Adobe Flash Player or Adobe AIR. | Yes. `protoc-gen-haxe` can run in Flash Players, browsers, servers, and even in Haxe compiler macros. || Run Time Type Information | Little, via native Flash API. | Yes. By parsing DescriptorProtoSet at runtime, users can access full information from `.proto` files. || Mutable messages | Yes | Yes || Readonly messages | No | Yes || Will unused code be eliminated? | No | Yes. `protoc-gen-haxe` separate different features into different classes, unused codes can be easy eliminated by the Haxe compiler. || Can users generated their custom code? | No. Users has to create another Protocol Buffers plugin. | Yes. Users can use `protoc-gen-haxe` API in Haxe macros. || Self-hosting | No. `protoc-gen-as3`'s compiler is written in Java. | Yes. Both compiler and runtime library of `protoc-gen-haxe` are written in Haxe. Even [20% lines of source code]( are generated by `protoc-gen-haxe` itself! || Is it a [protoc]( plugin? | Yes. `protoc-gen-as3` compiler must be launched by Google's `protoc`. | No. `protoc-gen-haxe` can directly import binary format DescriptorProtoSet of `.proto` files. |



Related Projects