Adding support for a new language

248 views
Skip to first unread message

Zaid Munir

unread,
Oct 17, 2017, 10:31:36 AM10/17/17
to Haxe
Our company is interested in using Haxe for our upcoming product. For this purpose we need to add support of Golang into Haxe. I was wondering how to approach this task. Any pointers/help in this regard would be highly appreciated. 

Justin Donaldson

unread,
Oct 17, 2017, 2:38:02 PM10/17/17
to Haxe
I wrote the Lua target a few years ago.  I documented some of the thought process in the git commits.  You can see them here:

git log --reverse --grep Lua

The pointers/steps to follow are:
  1. Learn OCaml... at least beyond a beginner phase.
  2. Understand how the generator fits in the context of the compiler (you write the generator part in the last block here: https://haxe.org/manual/macro.html)
  3. Write a stub generator, and start processing a few AST nodes (math operations are a good start) into some generated output.
  4. Keep handling more AST scenarios, and build up to a generator for handling IO and producing "hello world" in your given target
  5. Start in on the unit test suite, try and handle basic math/string/object operations
  6. Start handling more advanced unit tests
  7. Wow, these unit tests get really hard
  8. Make pleas for help on the haxe compiler group
  9. Get some help, and soldier on
  10. Pass all the unit tests
  11. Do the same for the sys tests
You're going to need help from the haxe community and the go community.  It's also helpful to check out the other language generators.  I played around a lot with genjs.ml, and even built genlua target off of a simplified version of genjs.  This helped me get started a bit faster, but it also meant I had to redo a lot of things down the road because I didn't understand the code as well.  I'd recommend starting from scratch and only use the other generators as a reference.



On Tue, Oct 17, 2017 at 7:31 AM, Zaid Munir <zaid...@gmail.com> wrote:
Our company is interested in using Haxe for our upcoming product. For this purpose we need to add support of Golang into Haxe. I was wondering how to approach this task. Any pointers/help in this regard would be highly appreciated. 

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Zaid Munir

unread,
Oct 18, 2017, 6:36:53 AM10/18/17
to Haxe
  1. Thank you, seems like a good starting point.
  2. ''Make pleas for help on the haxe compiler group'' :D :D :D Lets hope for the best.

Confidant

unread,
Oct 18, 2017, 11:16:12 AM10/18/17
to Haxe
Kudos to JD for such a helpful reply. :)

Cristian Baluta

unread,
Oct 18, 2017, 1:27:57 PM10/18/17
to haxe...@googlegroups.com
I learned from this book and I still find it very good after seeing other sources. http://courses.cms.caltech.edu/cs134/cs134b/book.pdf

On Wed, Oct 18, 2017 at 6:16 PM, Confidant <alter...@gmail.com> wrote:
Kudos to JD for such a helpful reply. :)

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--

Zed

unread,
Oct 18, 2017, 4:55:51 PM10/18/17
to haxe...@googlegroups.com
Thankyou for sharing the link, ive skimmed through the table of contents, looks very helpful. :)

You received this message because you are subscribed to a topic in the Google Groups "Haxe" group.

Zed

unread,
Oct 18, 2017, 4:56:16 PM10/18/17
to haxe...@googlegroups.com
Yup, kudos to him, very helpful indeed :)

On Oct 18, 2017 8:16 PM, "Confidant" <alter...@gmail.com> wrote:
Kudos to JD for such a helpful reply. :)

--

Zaxebo Yaxebo

unread,
Oct 18, 2017, 8:59:16 PM10/18/17
to Haxe
As  for businesses the time(implementation time) is money and If you need to implement haxe/golang in a tight  timeframe, then you may experienced
devs like justin Donaldson(implementor haxe/lua target) or waneck (implementor of haxe/java target) etc and get haxe/golang implemented.

  And then advantage may be that you people may really quickly move on to start with your real business applications which you want to do with by applying haxe/golang

Zax

Zaxebo Yaxebo

unread,
Oct 18, 2017, 9:00:27 PM10/18/17
to Haxe
As  for businesses the time(implementation time) is money and If you need to implement haxe/golang in a tight  timeframe, then you may HIRE experienced devs like justin Donaldson(implementor haxe/lua target) or waneck (implementor of haxe/java target) etc and get haxe/golang implemented.


  And then advantage may be that you people may really quickly move on to start with your real business applications which you want to do with by applying haxe/golang

Zax

On Tuesday, October 17, 2017 at 8:01:36 PM UTC+5:30, Zaid Munir wrote:

r8c...@gmail.com

unread,
Oct 19, 2017, 6:25:43 AM10/19/17
to Haxe
maybe you want to check this
Reply all
Reply to author
Forward
0 new messages