-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Per some brute force analysis, it's clear that several Nim modules (67) can potentially work in the VM. In fact, if you see test_nimscript.nims, there's at least 17 modules that are known and routinely tested.
However, the documentation only shows 4 modules as officially expected to work.
The goal of this issue is to track the work associated with doing the following in order:-
- Add (if not already present), VM test cases for all procs of the 4 documented modules
- Add VM test cases for all procs of 14 additional modules already in test_nimscript.nims
- Expand addition of VM test cases for the balance 48 modules
As PRs for the test cases are accepted, the nims documentation will also be updated to publish those modules as available.
If a particular proc in one of these modules doesn't work as expected in the VM, there are multiple options:-
- Don't add that module to the list at all since multiple such procs or minimal value in enabling it
- Open issues to fix proc in VM depending on validity, feasibility and value and then add module when issues are fixed
- Add the module but with a proc pragma that marks that specific proc as unavailable in the VM so that they won't be usable in nimscript and are automatically documented that they won't work in VM. This is contingent on this new pragma functionality being added to the Nim VM and corresponding docgen functionality.
As an aside, it's also useful to add another pragma or equivalent that marks a module as VM ready. This could help whitelist such modules so that availability is clear to end user.
There are more fundamental limitations of the VM such as memory management or missing FFI that prevent several other modules from even loading. Note the failures encountered in 0.18.0. These may be circumvented some time in the future but will be handled case by case after the existing list of modules are enabled.