vmops user guide #498
timotheecour
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
this should become a paragraph in manual eventually
when writing a new vmops, eg
copySign
(nim-lang#16406),if you run vm tests (eg:
nim r --lib:lib tests/stdlib/tmath.nim
) it may fail with:this is because you're running using a nim binary that wasn't compiled with
copySign
vmops, so it won't use theregisterCallback
in this case.It will succeed if you first bootstrap nim then run the test, but that's not good enough.
solutions (depending on the situation)
impl
) available (eg for js), you can use it in vm for old nim:(eg as in b23d13b)
defineSymbol("nimHasCopySign")
(nimHas
is typically a property of nim binary, not of stdlib); and then use it in code via:when defined(nimHasCopySign)
note
pending nim-lang#14648 (which was close for now...),
nimVersionCT
would simplify this, avoiding having to add yet another symbol in condsyms (instead relying on increasing versions, which is also more self-descriptive and easier to cleanup). We'd bump NimPatch by 2, eg:(1,5,1) => (1,5,3)
, and usewhen nimVersionCT >= (1,5,3):
links
compiler/vmops.nim
tests/vm/tvmops.nim
Beta Was this translation helpful? Give feedback.
All reactions