purescript-native icon indicating copy to clipboard operation
purescript-native copied to clipboard

go module initialization

Open joprice opened this issue 2 years ago • 9 comments

I had issues getting the tests working due to the go module having a replace directive, but not a requires directive. Running a go get for each module after writing the files works to get the tests to run. I'll put up a pr for that change after I verify it a bit more.

joprice avatar Mar 19 '23 19:03 joprice

Here's the fix on my wip branch for the new compiler version: https://github.com/joprice/purescript-native/commit/c749c91e0237ad529e8e113dff9c3b6de7e15d09#diff-d3e498a88b4c374b1edbd8693542a73e944d51a24a64a683658926ba655bc6ffR179-R196

joprice avatar Mar 19 '23 20:03 joprice

Thanks for your PRs! I haven't been keeping up with purescript (or obviously my project) for quite some time, but it is nice to see some recent activity. Are you using it for anything interesting?

andyarvanitis avatar Mar 28 '23 04:03 andyarvanitis

No problem. I'm only using it for experiments so far, but it fits the bill of a high level functional language that compiles to a relatively small self-contained binary, which is what excites me about it.

joprice avatar Jun 17 '23 16:06 joprice

@joprice I'm trying to build this today and I'm struggling quite a bit. Do you have any tips?

i-am-the-slime avatar Jul 03 '24 21:07 i-am-the-slime

This is the branch I believe I had mostly working, but I may have left it in a bad state https://github.com/andyarvanitis/purescript-native/compare/golang...joprice:purescript-native:upgrade-0.15. . I can try rebuilding and see if something has bit rotted, but curious what issues you're seeing?

joprice avatar Jul 03 '24 21:07 joprice

@joprice Very cool, I got it to work with your branch and fiddling with some useSystemGhc: true Now I have:

module project.localhost/purescript-native/output provides package project.localhost/purescript-native/output/Main and is replaced but not required; to add it:
	go get project.localhost/purescript-native/output
psgo: callProcess: go "build" "project.localhost/purescript-native/output/Main" (exit 1): failed

When doing spago build. Is this what this ticket is about?

i-am-the-slime avatar Jul 04 '24 09:07 i-am-the-slime

Okay, just heeding all these warnings makes it work. Exciting!

i-am-the-slime avatar Jul 04 '24 09:07 i-am-the-slime

Even found some old notes:

https://gist.github.com/i-am-the-slime/1ad096a51d155e619dae64f9829c2804

i-am-the-slime avatar Jul 04 '24 13:07 i-am-the-slime

Those are some thorough notes. Seems more like a getting started tutorial that should be added to the readme.

For some of the steps with Go module handling I was trying to tuck under the covers so you could just spago run and have it all work, but I only did Go years before they added modules so I’m not sure how you’re supposed to work with them exactly, whether the control should be left to the user.

joprice avatar Jul 04 '24 13:07 joprice