[swift-dev] swift module format

Coder coder at seasonsoftware.com
Sun Aug 27 18:11:02 CDT 2017


> You say this, but... I really hate for you to spend a lot of time on something that is so low-level and that is so likely to be unstable.  I think it would make a lot more sense to write a C API to the AST and talk to it over the OCaml FFI.  Or if you really want to avoid the FFI, you could take our current ASTDumper output, which is currently pseudo-machine-readable, and make it actually machine-readable.  The elegant approach there would be to take the entire dumper and remove its pervasive dependence on an output stream; instead, it would be rewritten to make calls on a SAX-like streaming interface, and there would just be a standard implementation that formatted things as XML / JSON / our weird s-expression format.

Yes, I would like to avoid FFI.
The second option could work well. I’ll look into it more. One benefit of not using ASTDumper is that haxe could generate swift without needing external tools.

Thanks again, the info is very helpful.

Aaron


More information about the swift-dev mailing list