juancarlospaco / nim-new-backend

Template to create a new Backend for Nim, based on the JavaScript Backend, as minimalistic as possible to focus on codegen
MIT License
41 stars 1 forks source link

Outdated #2

Open Yu-Vitaqua-fer-Chronos opened 2 years ago

Yu-Vitaqua-fer-Chronos commented 2 years ago

Heya, i just tried this with the current Nim versions on GitHub (in both the master branch and devel branch), but I'm getting this error:

/data/data/com.termux/files/home/nim-new-backend/Nim/compiler/vmops.nim(142, 8) Error: undeclared identifier: 'mm'
candidates (edit distance, scope distance); see '--spellSuggest':
 (1, 4): 'vm' [module declared in /data/data/com.termux/files/home/nim-new-backend/Nim/compiler/vm.nim(1, 2)]
FAILURE

It seems like the example is just incompatible with newer versions of Nim sadly

juancarlospaco commented 2 years ago

Termux was never supported, and it was just an example anyways.

Yu-Vitaqua-fer-Chronos commented 2 years ago

I don't think the issue is specific to Termux but fair enough

juancarlospaco commented 2 years ago

I dont think it is very fair, but I dont know how to make this maintanable in the long run, it is not accepted in mainstream, and I dont want to fork Nim itself, so it is kind of complicated, besides it was just an example repo about "how to" do it, ideas and pull requests are welcome...

Yu-Vitaqua-fer-Chronos commented 2 years ago

That's understandable, i think Araq talked about it being possible to use passes.nim without recompiling the whole backend? Haven't done much research into it but I'm definitely planning to, it'd be useful possibly to look into that for an alternative way of making a backend (while it wouldn't be exactly the same it'd probably would suffice for many people)

juancarlospaco commented 2 years ago

I am interested in this PR that would allow to "patch" Nim files without recompiling in theory, I dont know how much you can do with that tho, If Araq can teach you that, then feel free to implement it via pull request, I dont know if Araq should be spending time on this whatsoever, ideas and pull requests are welcome...

Yu-Vitaqua-fer-Chronos commented 2 years ago

Update on this, I am now working to create my own compiler backend for Nim, and I am doing it by using the Nim compiler as a library, Zerbina provided most of the code and currently i'm just working to get a semi-functional java backend for Nim (but time will be sparse soon due to college), repo can be found at https://github.com/Mythical-Forest-Collective/Nimpiler but note that nothing is actually functional (besides taking in a file and spitting it out)