Go2hx Work in Progress

go2hx alpha version 0.1.0 is now released! :tada:

Little backstory

(Feel free to skip if not interested)
I started off 2024 thinking it would be the year of a release and that massive improvements would be able to be made in relatively small intervals of time. In the end it was counter productive and caused the project to be in a limbo state, unable to hold to it’s goals.

Regardless improvements did get made and by the end of the year the mid goals for 2024 were starting to get realized.

A push was made to get Chroma a syntax highlighter in Go to get correctly compiled. Although this fell short because of more work needed for specific std libraries like embed and encoding/xml, it did get the underlying regex engine it uses called regexp2 to start to work. It also helped me make many improvements to the compiler to make this release possible such as a per function regression tracker, full support for goto statements, defer recover patterns, among many other.

Why release if it’s not finished?

Because it’s able to provide value today, it’s stable where stated, and a release means to me that the project is open to feedback, testing and more regular updates, which it is.

Sub-specification

(At time of posting)

  • All language features except, goroutines, channels, and generics.
  • All passing stdlibs (automatically updated via CI on the website) currently 20 stdlibs.
  • No unsafe support and no CGO (C extern system for Go)

Libs transpiled and released for direct use

regexp2 [api] [examples] ( original [go library] )

A full-featured regex engine, based on the .NET engine

haxelib git go2hx_regexp2 https://github.com/go2hx/regexp2

Go’s standard library [api] [examples] ( original [go documentation] )

haxelib git go2hx https://github.com/go2hx/go2hx

stdgo.X, where X is the stdlib, Table of working stdlibs.

trace(stdgo.unicode.Unicode.isGraphic('x'.code)); // true
trace(stdgo.image.color.Color.yCbCrToRGB(81, 240, 90)); // red

Outro of some nice memories along the way



regexp2 first time tests running

Try it out and have fun with it!
Feedback, issues, ideas are all welcome!

10 Likes