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._internal.bufioyes
stdgo._internal.bytesyes
stdgo._internal.compress.bzip2yes
stdgo._internal.compress.flateyes
stdgo._internal.compress.zlibyes
stdgo._internal.contextno_
stdgo._internal.cryptono_
stdgo._internal.crypto.internal.randutilno_
stdgo._internal.crypto.randyes
stdgo._internal.crypto.sha1yes
stdgo._internal.encodingno_
stdgo._internal.encoding.base64yes
stdgo._internal.encoding.binaryyes
stdgo._internal.encoding.gobyes
stdgo._internal.encoding.hexyes
stdgo._internal.encoding.jsonyes
stdgo._internal.errorsyes
stdgo._internal.flagyes
stdgo._internal.fmtyes
stdgo._internal.hashyes
stdgo._internal.hash.adler32yes
stdgo._internal.imageyes
stdgo._internal.image.coloryes
stdgo._internal.internalno_
stdgo._internal.internal.abino_
stdgo._internal.internal.bisectno_
stdgo._internal.internal.bytealgno_
stdgo._internal.internal.cpuno_
stdgo._internal.internal.fmtsortyes
stdgo._internal.internal.godebugno_
stdgo._internal.internal.godebugsno_
stdgo._internal.internal.oserrorno_
stdgo._internal.internal.platformno_
stdgo._internal.internal.pollno_
stdgo._internal.internal.raceno_
stdgo._internal.internal.reflectno_
stdgo._internal.internal.reflectliteno_
stdgo._internal.internal.saferiono_
stdgo._internal.internal.testenvno_
stdgo._internal.internal.types.errorsno_
stdgo._internal.ioyes
stdgo._internal.io.fsyes
stdgo._internal.logyes
stdgo._internal.log.internalno_
stdgo._internal.mathyes
stdgo._internal.math.bigyes
stdgo._internal.math.bitsyes
stdgo._internal.math.cmplxyes
stdgo._internal.math.randyes
stdgo._internal.osyes
stdgo._internal.os.execyes
stdgo._internal.pathyes
stdgo._internal.path.filepathyes
stdgo._internal.reflectno_
stdgo._internal.regexpyes
stdgo._internal.regexp.syntaxyes
stdgo._internal.runtimeno_
stdgo._internal.runtime.debugno_
stdgo._internal.slicesyes
stdgo._internal.sortyes
stdgo._internal.strconvyes
stdgo._internal.stringsyes
stdgo._internal.syncyes
stdgo.internal.sync.atomicno_
stdgo._internal.syscallno_
stdgo._internal.syscall.jsno_
stdgo._internal.testingno_
stdgo._internal.testing.fstestyes
stdgo._internal.testing.internal.testdepsno_
stdgo._internal.testing.iotestyes
stdgo._internal.testing.quickyes
stdgo._internal.text.scanneryes
stdgo._internal.text.templateyes
stdgo._internal.timeyes
stdgo._internal.unicodeyes
stdgo._internal.unicode.utf16yes
stdgo._internal.unicode.utf8yes
stdgo._internal.unsafeno_
stdgo.bufiono_
stdgo.bytesno_
stdgo.compress.bzip2no_
stdgo.compress.flateno_
stdgo.contextno_
stdgo.cryptono_
stdgo.crypto.internal.randutilno_
stdgo.crypto.randno_
stdgo.crypto.sha1no_
stdgo.encodingno_
stdgo.encoding.base64no_
stdgo.encoding.binaryno_
stdgo.encoding.gobno_
stdgo.encoding.hexno_
stdgo.encoding.jsonno_
stdgo.errorsno_
stdgo.flagno_
stdgo.fmtno_
stdgo.hashno_
stdgo.hash.adler32no_
stdgo.imageno_
stdgo.image.colorno_
stdgo.internal.abino_
stdgo.internal.bisectno_
stdgo.internal.bytealgno_
stdgo.internal.cpuno_
stdgo.internal.fmtsortno_
stdgo.internal.godebugno_
stdgo.internal.godebugsno_
stdgo.internal.oserrorno_
stdgo.internal.platformno_
stdgo.internal.pollno_
stdgo.internal.raceno_
stdgo.internal.saferiono_
stdgo.internal.testenvno_
stdgo.internal.types.errorsno_
stdgo.iono_
stdgo.io.fsno_
stdgo.logno_
stdgo.log.internalno_
stdgo.mathno_
stdgo.math.bigno_
stdgo.math.bitsno_
stdgo.math.cmplxno_
stdgo.math.randno_
stdgo.osno_
stdgo.os.execno_
stdgo.pathno_
stdgo.path.filepathno_
stdgo.reflectno_
stdgo.regexpno_
stdgo.regexp.syntaxno_
stdgo.runtimeno_
stdgo.runtime.debugno_
stdgo.slicesno_
stdgo.sortno_
stdgo.strconvno_
stdgo.stringsno_
stdgo.syncno_
stdgo.sync.atomic_no_
stdgo.syscallno_
stdgo.syscall.jsno_
stdgo.testing.fstestno_
stdgo.testing.internal.testdepsno_
stdgo.testing.iotestno_
stdgo.testing.quickno_
stdgo.text.scannerno_
stdgo.text.templateno_
stdgo.timeno_
stdgo.unicodeno_
stdgo.unicode.utf16no_
stdgo.unicode.utf8no_
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