#go2hx
1 messages · Page 2 of 1
Okay maybe it's a little too technical, I'm writing up take 2 real quick
- Look at the website for working stdlibs.
- Follow the go2hx library install instructions above.
- Add
-lib go2hxto your hxml for openfl/haxeflixel users<haxelib name="go2hx" /> - prefix path to the stdlibs with
stdgo - Import for example unicode/utf8
import stdgo.unicode.utf8.Utf8 - Use function
Utf8.runeCount
go2hx is a Go to Haxe compiler
I'll add it to the readme shortly
in the readme now
I found out a trick today
you can see all of the go stdlibs by running
go list std
277 total
19 vendored (3rd party support libs that the stdlib uses)
99 internal (not userfacing)
3 syscall (lowlevel pkg that os uses)
8 runtime (interface with the go runtime)
13 go (for use to print and parse go code)
total: 135
go2hx is now a 4 year old project Recap: 2757 commits 13 stdlibs passing 🌟 Very nice automatic updating website go2hx.github.io with quality custom docs and nice syntax highlighting. Per commit reg...
What will the try.haxe integration do?
Have a way to compile the go code into haxe code and then the haxe code sent to try.haxe to run
imo at that point you should just make your own playground
Based on that document, I'd say we are in between Q1 and Q2.
- ✅︎ Go test suite easy (no stdlib imports) 100% passing
(if all goes well by next week) go2hx early alpha release - ✅︎ (19 so basically yes) 20+ stdlibs passing
- go2hx.github.io 3rd party library search. No but the stdlibs are searchable and provide lots of information
❌ Bootstrapping the compiler (not a priorirty at the moment, really cool and cool to if it was pulled off, but the stdlibs for parsing go code, is not the same as the libs I want to release, and releasing takes precedence)
❌ Using go libraries in the compiler
If you guys are interested I could write a plan for 2025, it would be much more humble then last years but with a high chance of actually hitting the markers. I'd also not write plans after 3-6 months, because it's just too unpredictable
I'm against putting time into the playground, unless it would be worthwhile for the project. How I see it, getting the transpiled libraries into try.haxe would be the best situation.
I'm interested in ideas though, my current mindset now is if I get the compiler stable enough to pump out libraries all the other glamor is not as useful
at the same time I also want to grow a community around go2hx, so effort on that end for users to be interested, testing and giving feedback is worthwhile
[showcase] the docs are coming! Does the style looks good?
Looks nicer than ceramic api docs 😄
Well it's not a fair compeition, I'm not writing it by hand :p
I read showcase
Any reason that image/color is supported before other parts?
It's rlly cool tho :D
Like is it based on the order of imported by (high to low)?
Well there's 19 other stdlibs also working, I didn't announce most of them.
The reason why it's working is because it was 9/10 and the last test was using an unimplemented reflect.Value.call function that now has a basic implementation, and with that it satisfies the final test
Niceeee
The order is mainly due to complexity and focus I have on prioritizing certain fixes over others, I didn't intentially get image/color working, it just so happened I was trying to get reflect.Value.call working for some other tests and it passed image/color by coicidence :,)
Indeed :,) the hope is that is will fall faster and faster now
Why does so much rely on reflection though?
Let's pray
cgo will probably be a really substantial one
it's a big part of testing, the reflection features in go are really powerful, and they allow the creation of lots of heavy testing
not for the stdlib, but for 3rd party libs yes. it's a subsection though
most libs don't use cgo,, if cgo worked perfectly it'd increase the amount of translatable library by 10 thousand plus, but those libs also use unsafe and may have other issues. If someone wants to try and pull off cgo I will be fully down to support it, but it's not the priority atm for me
let me check, I pushed a fix for it, didn't check if it worked yet
Let's hope it works now
The fix is that I wasn't deleting everything from stdgo completly when rebuilding, so it was leaving previous files in that should've been removed
so build-js is not working yet, which is causing the stdgo regeneration to skip, so I can't see yet
once build-js works again I should be able to tell... that's my number prio to have working tonight
here is what it's hanging on
go to hx
Yes, what can I take for your order? The special today is text/scanner with a side of image/color
37 193 go libraries that import image/color
How about this?
I get the data from this ^
Or maybe this is more clear?
I'd like to publish in a clear way that X stdlib now passes all of its tests and should be able to be used now for projects if interested. Still unsure how to represent it, my plan was just to try out a few designs and get feedback and see what works the best
is that 37 thousand or 37 and 193 😂
probably thousand
just read it wrong at first
Haha I was thinking of whether to write 37,193 or 37.193
and thought I'd put a space and it'd be obvious but it's not 😂 I'll do a comma then
How about now, what do you think :,)?
lol good
it was only cause I read it when I woke up
wasn't something that I was used to
Yeah fair enough
lol
realised i use the ctrl shift o shortcut so much that i've just rebinded to f4
actually i'll rebind it to ctrl o, who cares about opening files that much 🤣
True! Yeah that shortcute is crazy useful, so much easier to jump around with it
If anyone here knows how to fix a bus error it would be greatly apperciated: https://github.com/go2hx/go2hx/issues/197
this is a test that works fine except on interp, and I don't know why
ah basically a segfault
Yep
CI is green again!
yayyyy
🎉
So name collisions have been fixed
Reverted the import initializer for stdlibs, that was causing runaway import graphs, I'm hoping with this change and a few others I'll get regexp2 working.
On top of that created a separate branch for new rewrite of go channels for the lzma compression library to get that working
Plan is to get these both working by Monday or Tuesday and then start semantic versioning for all 3 repos:
go2hx/go2hx
go2hx/regexp2
go2hx/lzma
go2hx use cases as I see it for Haxe ecosystem.
- Library does not exist in Haxe but does in Go
- Library exists in Haxe but it's old or target depedent and in Go it's not.
- Library exists in Haxe but it's platform specific (regexp, math, etc) and for go2hx it would be the same across targets.
- Library exists but it's buggy and not reliable, Go version is well tested and not buggy.
Cases against go2hx (to be objective about it)
- Might be too slow for performance critical libraries
- Code generation may be too big (mostly for js)
- Not easy to work with such as if the library uses encoding/json in go but you want to use haxe's Json
- Limited Go knowledge if there is an issue (specifically with the go2hx extern system)
- A given library simply does not work (because of all sorts of factors)
- Uses macros for reflection type data, don't want extra build time.
- Do not want longer compile times (2 to 5 seconds)
- Too complex for a given project needs (this is because of the compile times, big code gen, slow speeds, and/or not easy to work with.)
New channel rewrite that I started to get lzma working with @cerulean hornet is now pushed into master
Trying to get all cases of GoKey maps working, need to change entire functionality of a basic type so that it can work with a key... But once that's resolved I suspect regexp2 to run and pass it's tests and then into lzma and work on fixing any channel bugs
Niceeeeeeeee
That's lovely
And rapid fast
We'll see if I can hit the deadline of Tuesday, that will be the real test :,)
Yeah I won't I'll have a sanity check with my mentor on Tuesday, but I still want to shoot for it, because regexp2 has already worked and lzma is close.
The more open the project is to testing and use the better it will be in the long run, and that comes from putting out regular versions, and having usable libraries for people to use from it
@cinder sierra btw I've been meaning to ask about your current take on Choma, so is the highlighting not being good enough a show stopper?
My original goal of chroma was to replace the highlighter on the haxe.org site to finally remove the node dependency. If I was to carry through that, then yes, highlighting on Chroma's side would need to be way better. However, it seems like Rudy has his own plans for the Haxe website and if I were to redevelop it, it probably wouldn't be with Haxe itself anyways.
Damn gotcha, well good to know. I think it's a shame Haxe is not the goto tool for building it's own website, that's not a shame on your but for the ecosystem for not giving enough tools for it to be a no brainer
It isn't even that Haxe ecosystem's bad for it. I am sure you can toss something together that works fineish. But 11ty is very very good.
i'll defo be messing with wisdom at some point tho
wisdom isn't really suited for static stuff
there are a few
my favorite one is markdown to html :p
but yeah, for web dev i'll defo be messing with wisdom
01010111 made a simple one awhile ago
can't wait to have a project for it x)
what's so good about wisdom and 11ty?
wisdom is a haxe library, think of it like vuejs or react
oooh
11ty is a really feature complete static site generator, it is really simple to pick up compared to others i have played with
I don't know how I missed this, brain must have forgotten
haxeflixel, ceramic, and feathersui all use it (11ty)
damn might have to jump on the hype train eventually then
WWE stack would be lit, weblink+wisdom+entities
lol
!b have you used entities2 yet?
not yet no
most coding i've been doing is stabilising my project on native as that will be my main target
just sometimes lose track of that and end with a bit too much time on electron
hard to track down awkward issues but i think i'm mostly through the major hurdles now
I think the same thing, and then life/my code goes wait not so fast, and pulls a fast one on me
major hurdles come from continued deving, if it ramps down, or no new features are added then it's possible for the major hurdles to stop coming otherwise it's pretty inevitable
Guys!
Yea?
YEP except.... one test I have to make sure why it's EOFing
BUT YEAH big that it's this far along, SO HAPPY :>
Holyyy shittt
dang
looks good!
agreed!
thanks guys 
Exicted and all a little nervous not gonna lie, tommorow should be the day of release for regexp2 and the start of versioning for the compiler
Yeah true though!
Regardless it will be nice for at least the potential for others to use it too, I still have the libs I need for my projects, but those are farther out
^ that's when you'll really start to have fun 😄
Yeah 100%, but in the meantime I need the fun of it producing value for others in the meantime to get it to that point, or at least spark interest and join on this crazy idea with me :,)
But who knows maybe the stability of getting a release and better quality insurance will get the libs I want faster then I realize
here's what happened since my push for the release, so stats wise it seems possible
what's the stats measuring
it's percent of passing over total tests so for example: 13/14 is over 95%
7/14 is 50%
trying to measure in progress stdlibs, ones that can compile and run, but don't pass all of the tests yet
non compile ones don't show up, fully compiling ones also don't , and also I manually define what stdlibs to test or not
Gotcha yeah, it's mostly a tool for myself, though I personally find it cool to show off. It let's people see at a glance what stdlibs are at the middle stage
A great stage to see if anything can be pushed over the line to fully working that would be useful
I'd also love in the future to use the graph to nerd snipe people, but I think that comes later
Actually, it could work for static stuff without much change, if we added an utility to print html text from a VNode hierarchy
(but I would be questioning the relevance of it even if that's possible)
11ty is great for static sites
Soo lzma will not make the cut for the expected release for Today/Tomorrow of libs + compiler
Sorry @cerulean hornet :,( (Though still planned for after!)
Got super backed up on fixing file insensitive casing issue that effected pretty much the entire codebase and each case had to be manually rewritten...
Onto not life draining issues. Dox is working for the go2hx stdlib and will be released in the same timeframe.
And other good news an example case documenting regex failing on js and not on hl, and then using the regexp2 library to have it now work for js has been found and will be one of the examples for the lib.
All in all, thanks for all the support this week!
(You guys are seriously amazing who have stuck around and given the project hope)
I'm not expecting a major difference from prerelease to alpha release, user wise but I am optimistic it may give people a reason to test it out and stay more tuned into the updates.
- It will also provide better stability for users/contributors (no more breaking master)
- dox api for the stdlib and working 3rd party libs compiled under the go2hx umbrella
- Updates on github in the form of releases
- Semantic versioning
- Updates will also start to be written on the Haxe community form again (maybe like a monthly thing)
- Better community building, I'll be more active in discord and I'm hyped to get more suggested 3rd party libs working.
- Clear communication on what should work and what will likely not, with explanations to figure it out yourself for various libs you are interested in.
no worries man, take your time
Also good to hear the problem was fixable :D
Yeah like all problems there is a solution, I'm glad that this quasi deadline is set otherwise I would've dragged my feet on it for probably a week because it's quite tedious
Sooo update
- the file insensitivity issue branch is working and now merged to master
- go2hx std now has an api website
- regexp2 library with example created, and testing it against multiple targets using CI
Does the file insensitivity issue also apply to Windows?
Iirc go behaves differently regarding file insensitivity depending on the platform
Yes
It's not about Go but more because I split all variables into seprate files to improve the Haxe depedency graph of go2hx programs it has caused Unicode_pP.hx and Unicode_pp.hx to be a thing
Now if that happens it will merge the 2 variables together in a file that matches the lowercase equivlant
Tldr: broke lots of stuff, now fixed, onto release!
Ahhh gotcha!
Sneakpeak of regexp2 lib if anyone has early feedback https://github.com/go2hx/regexp2?tab=readme-ov-file#regexp2
Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a
more feature full regex engine behind the scenes.
It doesn't have constant time guarantees, but it allows backtracking and is compatible with Perl5 and .NET.
You'll likely be better off with the RE2 engine from the regexp package and sho...
[showcase] I proudly present, regexp2 a go library porting the .NET regex engine, now transpiles into Haxe code correctly! Passing the tests!
This is a major milestone for the compiler to be able to compile non trivial libraries.
Try it out, give feedback, and more to come!
example program:
import github_dot_com.dlclark.regexp2.Regexp2;
function main() {
final r = Regexp2.mustCompile("^(abc|xyz)?(?(1)abc|xyz)", 0);
// left because it's a return tuple of (bool,error), right would give the error field
trace(r.matchString("abc").left);
trace(r.matchString("xyz").left);
trace(r.matchString("def").left);
}
lib:
https://github.com/go2hx/regexp2
output:
https://gist.github.com/PXshadow/a97a898ff7641befdab2c89416e54b9d
Hehe :) I'll probably join the discord later today if peeps want to hang out
I can only join in the evening sadly
No worries what time about like 6?
Gotcha, yeah that's too late for me, next time though
Alright :D
guys we are moving to a new house come down from the attic and pack your things!
#haxe-go
it was getting cramped up there
hopefully the new attic is a bit more spacious
maybe we'll get an entire basement 😮
maybe.. or maybe you will sleep on top of the roof
tbd based on how much haxing you do next week
@cerulean hornet well done for getting the tests green! When you get a chance look through my review
I've taken a look and replied :D
I think you missed one, if I am not missing something https://github.com/go2hx/go2hx/pull/204#discussion_r1947541010
and the most important one! hehe but other one is resolved :]
I think pending means I can't see it
Oh
kind of dumb UI I did the same shit too
Had the review sit for hours before I realized you coudn't actually see it
can you see it now?
batshit stupid even LOL
lol why are you still talking in here
ye
MKI hates the new house appperently
#haxe-go
I think you can lock this thread
he is a house hatter he loves the attic
Or maybe !b has to
wdymmm
you started the convo in here
but what if we need another house to crash in
I think reflaxe has a couch
yeah okay good enough
Found a gem of an article today: https://andysblog.uk/why-blog-if-nobody-reads-it/
AH shoot, sorry it's just the one that is closer to the top
I'll have to hide it or something
😆
a few of you may die, but it will give @blazing heath peace of mind so it's worth xd
then not worth
if you want to stay here, I won't stop you heck we can even keep talking in here idc :p
whatever is more chill
The big up sides to the #haxe-go channel is, easier for others to see it, and more control like pings and I think we can even do go2hx annoucments or something cool like that
you have access to /everyone in here
and not in #haxe-go ? I don't know how the command works, I am scared to try it haha
channel no
in threads /everyone pings everyone who's watching the thread
in channels it pings the whole server
channels don't affect visibility of a project also... it's more superficial visibility than any kind of real benefit. The visibility is driven by activity
I see, would be interesting to use it for regular weekly updates but at the same time, might annoy people
Well I think channels are nice that everyone can see them by default
for projects it's only ones where I have wrote a message show up for me
yeah I understand
also if you do ctrl + t in discord, you get a channel spotlight search
can be easier to navigate to where you want to go
thanks I'll start usuing that more, only been using it to jump discords, but I'll try it for channels here too
yeah it's not even my fault!
the projects section is always higher up so I just naturally write here and then realize it's not the channel
heh
just let me cross post here 
like the voice chats /s but seriously don't do it if it would take any sort of time
its possible and it won't take a lot of time but it defeats the purpose of the channel so I won't do it 😂
yeah logical
it would be cooler if discord let us favourite channels or something
but alas such a thing doesn't exit
let's say hypothetically there was a new channel "owner" and he was unsure what is the full understand purpose of a channel, how would he go about figuring it out
you don't need to, just do what you're doing in here over there
ah okay phew, I thought I was missing something else
nope 😄
could we just lock this thread
never
that feature is in beta in some servers
it sucks, ruins discoverability
how is it implemented
Like Slack
You have a list of channels that you opt in to
doesn't this basically already exist?
for discord
you can opt out of channels already
I don't think that's the same thing as favourites
out of curiosity, why do you think its a tool?
is there something off about it?
To the contrary, it looks well done
i see
@cerulean hornet made a webpage for me to input the info and add a background and then it outputs the image, it looks really slick and I'm happy to finally get to use it
I agree it looks cool, wanted to see if i could pull up stats for other libs
sadly you have to (currently) manually enter info
You can find the stats here https://pkg.go.dev/std , once you pick one it says imported by X
thanks!
go2hx
Yes you called? 
daz is true
go go go(2hx)
go go go2hx
Is there a docker container that runs go2hx out of the box?
