Hey there I am about to design my first multi-language library using hx.
For that I am trying to figure out the builtin capabilities for processing XSD (XML Schema Definitions) using the standard lib. I have tried to find some answers in the manual and api docs but apparently, there is no builtin XSD handling (so I have to write my own lib to do that, correct?).
Optimally, I would want to generate my Model Classes based on a given valid .xsd file, similar to what NETFX or JAXB are doing. I was also thinking to let JAXB to transform the schema into Java classes, then from Java to hx but I don’t know if that’s possible either.
Any pointers into a direction towards something usable is much appreciated
Haxe has a small ecosystem primarily focused on games and applications. The standard library is very minimal compared to Java or .NET so expect most functionality to be found in third party libraries, not in the standard library.
Searching on github I found an old XSD library, you’ll likely need to update it to work with a newer version of Haxe: h3compat (for Haxe4) and h4compat (for Haxe5) will help with easier migration.
If you run into issues with the library Haxe also offers ways to use target libraries, either via externs or in the case of c# (removed in Haxe 5) and jvm/java: external libraries can be auto parsed and typed, for use in Haxe (example)
I am also building another route to make Haxe more viable in more domains, by writing a Golang to Haxe compiler called go2hx. Feel free to try it out and reach out, if the other routes don’t work out.
Good luck with your programming projects in Haxe, and welcome to the community!
Thanks a lot for the welcoming and helpful answer!
I am actually working in science and came to Haxe, because I intend to develop libraries more “language independent”. By that I hope to maximize openness and reuse while at the same time have a “single source of truth” in my codebase.
I will definitely check out the library and see how far I can get!
One more question though - is there a specific reason why c# is being dropped in v5?
Awesome! “single source of truth” sounds like an interesting concept, hope you’ll make updates here, would be interested to see what it becomes!
Simon the lead maintainer of the Haxe compiler, described the reasoning in a conference 2 years ago (27:55), the short of it is that C# has massive technical debt based on it’s design and lack of maintainer, and every time they add features to Haxe, the compiler team often time get stuck trying to update the C# target with the additions.