LingDong- / wax

A tiny programming language that transpiles to C, C++, Java, TypeScript, Python, C#, Swift, Lua and WebAssembly 🚀
https://waxc.netlify.app/
MIT License
793 stars 45 forks source link

More languages transpiling support #15

Closed ghost closed 3 years ago

ghost commented 3 years ago

@LingDong- I ❤️ how wax works and if possible to see more languages wax can transpile to in near future i would be very grateful...

Languages like JavaScript, Ruby, Lisp (Or Scheme), PHP, Kotlin, Objective-C, and more... Not forcing ya, But if there are any guide about adding transpilers i can work on one if possible!

And thanks for wax!

ghost commented 3 years ago

I've done JavaScript transpiler! ❤️

ghost commented 3 years ago

Done CoffeeScript and Kotlin transpilers! ❤️

LingDong- commented 3 years ago

Hi @Rabios ,

Thanks so much for the interest in the project and making the transpilers!

I'd be happy to take a look if you share the code, and I can include a link to them in the main README. But currently I'm not sure if I'll merge all of them to the main repo, at least for now -- current 9 languages is already quite many to maintain! If maybe one day wax is used by more people and another target language is requested by many, then I probably add it.

I originally picked these 9 languages to maximize audience per amount of work on my side, e.g.: Objective C is a super set of C so the C transpiler get Obj-C users covered too, Kotlin also uses JVM so the Java transpiler should get those users covered, TypeScript compiles to JS so JS users should be OK with the TS transpiler, etc.

That said, I think it's great to have more transpilers for wax. Indeed the main goal of wax is to be transpilable.

So I'm thinking perhaps a good middle ground for now is to keep the 9 "main" targets for wax, as well as more community-supported additional languages (like Ruby, Lisp, PHP, Kotlin, etc you mentioned). I'm also imagining these that transpilers can be coded with simple scripting languages like python/js/ruby instead, by reading the JSON-format syntax tree generated by the main waxc porgram. This way 1) users won't need to recompile/link the main program. 2) transpiler writers won't need to understand C or how my implementation works, and can write in their preferred langs. Perhaps I can make waxc support writing to stdout, so the command for transpiling to additional languages this way can be as simple as waxc --json | ruby to_ruby.rb, etc.

Thanks again, and curious to hear what you think!

ghost commented 3 years ago

About source for transpilers, I have plan to push them in fork of my own very very soon, Won't take long time...

ghost commented 3 years ago

@LingDong- Now added transpilers i made them to my fork! https://github.com/Rabios/wax

NOTE: Some transpilers, Like Kotlin transpiler still experimental...

ghost commented 3 years ago

Closing this as i'm doing this on my own fork: https://github.com/Rabios/wax