https://github.com/go2hx/go2hx
  
  
    Import Go libraries in your Haxe projects Go -> Haxe source-to-source compiler 
    https://github.com/go2hx/go2hx
  
compile compiler go golang haxe haxe-transpiler tardisgo transpiler traspile
        Last synced: 4 months ago 
        JSON representation
    
Import Go libraries in your Haxe projects Go -> Haxe source-to-source compiler
- Host: GitHub
 - URL: https://github.com/go2hx/go2hx
 - Owner: go2hx
 - License: mit
 - Created: 2020-11-02T12:26:46.000Z (about 5 years ago)
 - Default Branch: master
 - Last Pushed: 2025-06-25T16:17:25.000Z (4 months ago)
 - Last Synced: 2025-06-25T16:30:46.103Z (4 months ago)
 - Topics: compile, compiler, go, golang, haxe, haxe-transpiler, tardisgo, transpiler, traspile
 - Language: Haxe
 - Homepage: https://go2hx.github.io/
 - Size: 150 MB
 - Stars: 136
 - Watchers: 8
 - Forks: 14
 - Open Issues: 29
 - 
            Metadata Files:
            
- Readme: README.MD
 - Contributing: CONTRIBUTING.MD
 - License: LICENSE
 
 
Awesome Lists containing this project
- awesome-go - go2hx/go2hx - > Haxe source-to-source compiler ☆`140` (Go Compilers / Search and Analytic Databases)
 - awesome-go - go2hx/go2hx - > Haxe source-to-source compiler ☆`136` (Go Compilers / Search and Analytic Databases)
 
README
          
Import Go libraries into your Haxe projects.

[](https://github.com/go2hx/go2hx/actions/workflows/main.yml) [](https://discord.gg/jgPcqC7DY2)
> Spiritual successor to [Elliott Stoneham's compiler](#credits)
## Installation
> [!WARNING]  
> Early alpha version, not able to compile most Go code correctly
* [Download Haxe 4.3.2+](https://build.haxe.org/builds/haxe/)
* Hxcpp haxe library is required for the compiler
```sh
haxelib git hxcpp https://github.com/haxefoundation/hxcpp
```
## Getting started
Compile a Go library (example: unicode) to Haxe with the following command line:
```sh
haxelib run go2hx unicode
```
Now include the outputted code into your project hxml or equivalent:
```hxml
-cp golibs
--macro Go2hxMacro.init()
```
You can now import the Go library and use it in your Haxe project (example: unicode):
```haxe
import stdgo.unicode.Unicode;
function main() {
    trace(Unicode.isGraphic('g'.code));
}
```
See the [website](https://go2hx.github.io) for more details.
### Latest update on Youtube
[](https://www.youtube.com/watch?v=qVaynJJ941M)
# Project status
The project is currently in a early alpha state. Not able to compile most Go code. Most Go language features are extensively tested and will likely work in isolation, that are not explicated excluded such as generics and unsafe.
## Setup from source
Clone the repo using recursive, as the project relies on git submodules.
```sh
git clone --recursive https://github.com/go2hx/go2hx
```
```sh
cd go2hx
haxelib dev go2hx .
haxelib run go2hx build
```
In case you forgot to add ``--recursive``:
```sh
git submodule update --init --recursive
```
## Join in on the fun!
[Haxe #go2hx discord channel](https://discord.gg/jgPcqC7DY2).
Read the [contributing guide](./CONTRIBUTING.MD) for insights and information on adding code into the project.
# Credits
A spiritual successor to Tardisgo written by [Elliott Stoneham](https://github.com/elliott5),
A maintainer, mentor, and code contributor of this project, go2hx would not exist without him.