You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made an attempt to get the marshal module working in the JS backend and it's not so easy. After fixing the lack of copyMem in streams.nim I was faced with a bunch of internal errors.
To fix the copyMem I added the following to streams.nim:
Then I started seeing internal errors in genDeref, on the following line in the typeinfo module:
...result=cast[ptrbool](x.value)[]
...
Some relevant discussion on IRC is available here.
As far as @Araq told me, cast[T](x) is mapped to x in the JS backend and x[] is mapped to x[0], it therefore stands to reason that cast[T](x)[] should be mapped to x[0].
Not sure how to implement this unfortunately. There is also a problem when assigning a pointer to another pointer (an internal error in genAsgn). These errors can be mitigated to some extent by hacking around with emit but I don't think this solution is correct.
The text was updated successfully, but these errors were encountered:
I have made an attempt to get the
marshal
module working in the JS backend and it's not so easy. After fixing the lack ofcopyMem
in streams.nim I was faced with a bunch of internal errors.To fix the
copyMem
I added the following tostreams.nim
:Then I started seeing internal errors in genDeref, on the following line in the typeinfo module:
Some relevant discussion on IRC is available here.
As far as @Araq told me,
cast[T](x)
is mapped tox
in the JS backend andx[]
is mapped tox[0]
, it therefore stands to reason thatcast[T](x)[]
should be mapped tox[0]
.Not sure how to implement this unfortunately. There is also a problem when assigning a
pointer
to anotherpointer
(an internal error ingenAsgn
). These errors can be mitigated to some extent by hacking around withemit
but I don't think this solution is correct.The text was updated successfully, but these errors were encountered: