Closed pietroppeter closed 1 year ago
I feel like nbCodeToJs
is falling apart like a house of cards :rofl: So the specific issue is that exportc
isn't respected? Or is it mangled names in general?
I feel like nbCodeToJs is falling apart like a house of cards 🤣
hey, we are using it! if it does not break it is not fun 😝
So the specific issue is that exportc isn't respected? Or is it mangled names in general?
I would expect that exportc will be respected but the js we generate from original code has a mangled name and one of the purpose of exportc would be to avoid further mangling so that an external library is able to guess the correct name.
related: https://forum.nim-lang.org/t/9341
hey, we are using it! if it does not break it is not fun :stuck_out_tongue_closed_eyes:
Haha true :rofl: If it wasn't for Karax we wouldn't have to mangle anything at all, but then we wouldn't have Karax :upside_down_face:
I would expect that exportc will be respected but the js we generate from original code has a mangled name and one of the purpose of exportc would be to avoid further mangling so that an external library is able to guess the correct name.
Okay, that I should be able to solve in the mangling logic :+1:
related: https://forum.nim-lang.org/t/9341
Worth noting is that as we can only have a single exported proc of each name, we are limited to 1 p5
instance per nimib page.
Worth noting is that as we can only have a single exported proc of each name, we are limited to 1 p5 instance per nimib page.
indeed in p5js there is a different mechanism if one wants to have multiple canvas on the same page:
Look at that, nice :)
Just realized by looking at your bouncing ball blog post that {.push exportc.}
also exists :sweat_smile: That's a totally different beast to try and parse. Would it be fine if we forced users to {.exportc.}
all symbols individually for now?
fixed by #125
as a simple example I was trying to test the following:
apart the fact that library nimp5 is currently broken (see https://github.com/Foldover/nim-p5/issues/1), the js that is created has mangled names:
in order for this library to work, we would need to be able to avoid the mangling for names draw and setup (so that further js compilation tagged with export does not mangel them any further).