Closed halloleo closed 1 year ago
Ropes
had been changed to be actually string
in devel of Nim in https://github.com/nim-lang/Nim/pull/20433, use the Nim commit before that change and it works.
Hey @juancarlospaco, thanks for chiming in so promptly!
I now tried it with the commit you mentioend in the README (ff25103c9ab9d51821e9e8641955c8d24f7db6b8
), but with that I get:
/Users/alba/devel/nim/pretty-printed-javascript/Nim/compiler/jsgen.nim(185, 29) Error: undeclared identifier: 'doAssert'
FAILURE
(To be precise what I did was:
$ git clone https://github.com/nim-lang/Nim.git
$ cd Nim
$ git checkout ff25103c9ab9d51821e9e8641955c8d24f7db6b8
$ rm compiler/jsgen.nim
$ rm lib/system/jssys.nim
$ curl -Lo compiler/jsgen.nim https://raw.githubusercontent.com/juancarlospaco/nodejs/main/tools/jsgen.nim
$ curl -Lo lib/system/jssys.nim https://raw.githubusercontent.com/juancarlospaco/nodejs/main/tools/jssys.nim
$ ./build_all.sh
)
Try 3fef2fd52c86ba922187ca03026b09ceb70b5d3d
.
Assertions had been removed in devel of Nim, they are a separate module now https://nim-lang.github.io/Nim/assertions.html
Ideally those changes should be in mainstream to avoid these kind of out of sync problems... :shrug:
Thanks. Got Nim compiled with the commit 3fef2fd52c86ba922187ca03026b09ceb70b5d3d.
Will try your JS backend out! 😄
Should I check out the nodeJS repo and create a little PR adding the commit info your README?
It was like that https://github.com/juancarlospaco/nodejs/commit/a578730d77949ab0d30fdf53cb3f8fa98e04a44f It was just too much big changes in Nim devel, but it is maintained. Any improvements are welcome.
I see!
But I don't understand, why did you change in the README the commit your stuff is suppose to work with from 3fef2fd52c86ba922187ca03026b09ceb70b5d3d
to ff25103c9ab9d51821e9e8641955c8d24f7db6b8
, if the latter doesn't work?
Sorry, this might be a total newbie question...
Bug, mistake.
I see. Should it be changes back?
Yes can be, until the patch is fixed.
So basically it works, it may not be always in sync with devel but I see no better way if it is not accepted upstream, and then nothing really critical going on here, I will close for now...
Fair enough. I don't understand the intricacies why it changes over time which commit works, but that's what it seems to be.
I might add a note about it on the forum or wiki?
why it changes over time which commit works
Because Nim mainstream changes, ideally this would be somehow integrated into Nim, at least with some changes, at least for Nim 3.0, but is hard to convince core devs, but I think that would bring more donations and contributions to Nim in the long run.
I am trying to build the Nim compiler with the Pretty-Printed JavaScript backend from https://github.com/juancarlospaco/nodejs/tree/main/tools.
On the
.build_all.sh
command I get the following error:(Full command output in this gist.)
Any idea what's going wrong?
BTW, the commands in your README I had to modify slightly: All backslashes (like in
rm compiler\jsgen.nim
) I changed to forward slashes (e.g.rm compiler/jsgen.nim
).