go2hx

warning: experimental version.

Compile Go to Haxe.

Use Go libs with ease!

Get started!

Manual

Standard Library compatibility/api docs

Library compilation and test results

moduledocstestshl
stdgo.bufioyes
stdgo.bytesyes
stdgo.compress.bzip2yes
stdgo.compress.zlibyes
stdgo.contextno_
stdgo.crypto.randyes
stdgo.crypto.sha1yes
stdgo.encodingno_
stdgo.encoding.base64yes
stdgo.encoding.binaryyes
stdgo.encoding.gobyes
stdgo.encoding.hexyes
stdgo.encoding.jsonyes
stdgo.errorsyes
stdgo.flagyes
stdgo.fmtyes
stdgo.go.astyes
stdgo.go.constantyes
stdgo.go.importeryes
stdgo.go.printeryes
stdgo.go.tokenyes
stdgo.go.typesyes
stdgo.hashyes
stdgo.image.coloryes
stdgo.internalno_
stdgo.internal.abino_
stdgo.internal.bisectno_
stdgo.internal.bytealgno_
stdgo.internal.cpuno_
stdgo.internal.fmtsortyes
stdgo.internal.godebugno_
stdgo.internal.godebugsno_
stdgo.internal.oserrorno_
stdgo.internal.platformno_
stdgo.internal.pollno_
stdgo.internal.raceno_
stdgo.internal.reflectno_
stdgo.internal.reflectliteno_
stdgo.internal.testenvno_
stdgo.internal.types.errorsno_
stdgo.ioyes
stdgo.io.fsyes
stdgo.logyes
stdgo.log.internalno_
stdgo.mathyes
stdgo.math.bigyes
stdgo.math.bitsyes
stdgo.math.cmplxyes
stdgo.math.randyes
stdgo.osyes
stdgo.os.execyes
stdgo.pathyes
stdgo.path.filepathyes
stdgo.reflectno_
stdgo.regexpyes
stdgo.regexp.syntaxyes
stdgo.runtimeno_
stdgo.runtime.debugno_
stdgo.slicesyes
stdgo.sortyes
stdgo.strconvyes
stdgo.stringsyes
stdgo.syncyes
stdgo.sync.atomic_no_
stdgo.syscallno_
stdgo.syscall.jsno_
stdgo.testingno_
stdgo.testing.fstestyes
stdgo.testing.internal.testdepsno_
stdgo.testing.iotestyes
stdgo.testing.quickyes
stdgo.timeyes
stdgo.unicodeyes
stdgo.unicode.utf16yes
stdgo.unicode.utf8yes
stdgo.unsafeno_
FAQ

Can library X be compiled?

Maybe, to see if the library is supported at the moment go get library_here the library and then run:

go list -f '{{ .Imports }}' library here

Then check to see if the standard libraries used are all passing with the compatibility table above.

Does the compiler support Go as a Haxe target?

No and it's not within the scope of the project.

Why not use externs instead of compiling Go code into Haxe?

Because externs can target lock a code base and they require maintenance, abstraction code etc.

Cgo support?

Not available but planned and happily accepting contributions for it!

How does this compare to Gopherjs or Go wasm?

go2hx's design is built with Haxe devs in mind, therefore the goals align with Haxe dev advantages of the compiler, with that said go2hx does have some advantages already, smaller code generation, access to Haxe's compiler tooling such as dce and optimizations, and Haxe as a language being very portable, high level and statically typed.

What internals does stdlib use?

go2hx's compiler, compiles the standard library packages for example os. After compilation a Patcher system switches out functions/variables/structs for a Haxe equivalent, for example os.Open uses sys.io.File.read and sys.io.File.write.

Contributing:

The project is still at an experimental level, so expect undocumented problems to spring up. The best way to contribute is to simply use the compiler on code you would like and inevitably run into errors. From there we can answer some questions to see:

how to proceed!

What time is the error happening?:

How can the code causing the error be reduced to a simple sample?

println(reflect.TypeOf(value).String())

Does the code throw "not implemented" error?

Is the type casting invalid?

Have issues and/or want to contribute?

github discord