On Thu, Feb 20, 2025 at 11:38 AM Tim Tommerson <[email protected]> wrote:
> Hello , > > Thanks for your reply. I am doing this for fun, so its not a huge deal. > And possibly a learning experience as this is all new to me, so I apologize > if I am confusing. > > I recently tried using a few projects which use emscipten via nimlang -> > emscripten integration. When I checkout the latest packages the recent > change to bool from int , emsdk > <https://github.com/emscripten-core/emscripten/commit/3dfabe6ded598cd23c64968ae213ea98a0ad180> > cause emscripten compilation to fail (From what I gather on the nimlang > side). So Im sure now this is likely an issue with either nimland or > nico(the nimlang game engine im using). > > Initially reverting the change from bool back to int fixed everything. > Since that didnt feel right to me the only other way I could get it to stop > complaining was by adding the following to nim and nico: > > Add cbool to ctypes.nim > <https://github.com/maxpicklez/Nim_with_cbool/compare/nim-lang%3ANim%3Adevel...devel> > (Nim) > Change function definition > <https://github.com/maxpicklez/nico/compare/ftsf%3Anico%3Amain...main> > (nico) > Those fixes look about right to me. Apologies for the breakage, that type of other-language binding did not occur to me when I made the int->bool change a while back. > Now I'm not naive enough to think this actually solves the issue, it just > brought me to the end of compilation and seems to work. I am simply trying > to illuminate the problem and looking into where to look/how to resolve it. > > > > > > > > > On Thu, Feb 20, 2025 at 2:00 PM 'Sam Clegg' via emscripten-discuss < > [email protected]> wrote: > >> Could you elaborate a little bit on what the problem with using `bool` >> is? Could you perhaps link to your issue/discussion? >> >> We use `bool` a bunch now in emscripten, including at the wasm/JS >> boundary. >> >> I have seen one issue where we were passing values other than 1 or 0, and >> the C compiler was treating it as undefined behaviour. >> >> Other than that, I don't think I've heard of any other issues. If this >> issue seems like a serious blocker on your side perhaps open an issue in >> the bug tracker and we can continue discussion there? >> >> cheers, >> sam >> >> >> On Thu, Feb 20, 2025 at 9:30 AM Tim Tommerson <[email protected]> >> wrote: >> >>> Hello, >>> >>> I recently hit a snag using nim with emscripten. The issue was caused by >>> a recent commit: >>> >>> >>> https://github.com/emscripten-core/emscripten/commit/3dfabe6ded598cd23c64968ae213ea98a0ad180f >>> >>> The commit changes the type signatures to bool from int which caused an >>> issue with ctype support in the nim language. This may be specific to the >>> integration of emsdk as opposed to nimlang itself. However I just wanted to >>> ask here if the change to bool from int would cause more issues down the >>> line, specifically in regard to C23 and its redefinition of bool. >>> >>> Ive engaged with the nimlang matrix chat to make them at least aware of >>> the issue. The fix from there end for me at least was to add a hackyfix to >>> the ctypes to make it work, though that will have to change when C23 is >>> supported I guess. >>> >>> thanks for your time >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "emscripten-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion visit >>> https://groups.google.com/d/msgid/emscripten-discuss/4bd55732-08fb-4241-b74a-3f5039778ed9n%40googlegroups.com >>> <https://groups.google.com/d/msgid/emscripten-discuss/4bd55732-08fb-4241-b74a-3f5039778ed9n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion visit >> https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2_Fm7J6_GOAHjQeVBSEE-2m66%2BULcH1htOYxBYt5aTrJg%40mail.gmail.com >> <https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2_Fm7J6_GOAHjQeVBSEE-2m66%2BULcH1htOYxBYt5aTrJg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/emscripten-discuss/CAHyz_AkGeig8qgSVUUftvxNiE0ybO1kiqGXN8j-fjA0jq6stfw%40mail.gmail.com > <https://groups.google.com/d/msgid/emscripten-discuss/CAHyz_AkGeig8qgSVUUftvxNiE0ybO1kiqGXN8j-fjA0jq6stfw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va29Zv1iQ3oG_fkdTHyr9RWJnHeJ_8JiwrkJ%3DQsRm4KXhFQ%40mail.gmail.com.
