andyarvanitis / purescript-native

A native compiler backend for PureScript (via C++ or Golang)
http://purescript.org
Other
632 stars 40 forks source link

Update to PureScript 0.13.8 #54

Closed i-am-the-slime closed 4 years ago

i-am-the-slime commented 4 years ago

This updates to the latest released version of PureScript.

andyarvanitis commented 4 years ago

Awesome, thanks, I'll have a look asap (hopefully today or tomorrow). It's not well documented, but have you tried running the standard test suite using psgo --tests? I usually run it using a previous build, then again with the new, and compare the outputs. If not, I can try it before I merge. Note that the current release of psgo works fine with purs 0.13.8 and spago master (at least it passes all of the standard tests run as just described).

andyarvanitis commented 4 years ago

Also, it looks like you used a code formatter which changed enough whitespace and formatting style to make it harder to see what's actually changed. It(?) also removed some comments?

i-am-the-slime commented 4 years ago

Good point about the formatting. I removed it. Now the change should be quite obvious. Mostly ModuleName just holds Text now when before it was a List.

My main motivation for touching psgo is that since yesterday spago master has a change that will pass the module name to psgo alongside --build. This leads the parser for arguments to put the module name (Main.main by default) in the files bucket rather than treating it alongside the --run command. This change doesn't help with that.

I suppose a better way of doing the parsing would be to move the parsing of options to optparse-applicative. I also tried to understand what the purerl backend is doing in this regard and whether the option parsing could be stolen but my brain failed.

I wouldn't mind using an older version of spago, however I'd really like to be able to run tests with the go backend which is my real motivation.

I'm currently running the tests with psgo --tests, for that I needed to create a file called add_psgo_to_spago_config on my path:

#!/usr/bin/env bash
perl -pi -e 's/^}/, backend = "psgo"\n}/' spago.dhall

I'll try to compare the outputs when this is done running.

i-am-the-slime commented 4 years ago

Update: It breaks. I'm doing something wrong.

andyarvanitis commented 4 years ago

Thanks for the updates. It might not be anything you're doing wrong (it doesn't seem like it would be). And sorry, I forgot about the dependency on the add_psgo_to_spago_config script for running the tests. It was only supposed to be a temporary thing.

I suppose a better way of doing the parsing would be to move the parsing of options to optparse-applicative.

Yes, definitely. I just did something quick-and-dirty since psgo needed very few options at the time.

I wouldn't mind using an older version of spago, however I'd really like to be able to run tests with the go backend which is my real motivation.

See my notes in that ticket (#45). Also keep in mind that, as mentioned above, I tested the current psgo release (from Dec) with spago's latest changes (its master, which includes the --run changes), and purs 0.13.8, and they all still work together. The corefn AST hasn't seemed to change with recent purs releases, which would allow this.

i-am-the-slime commented 4 years ago

I agree that everything still works and there's not much point in pursuing this right now. I will close this in favour of getting the arg parsing and passing to work.