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'm getting from the readme and skimming the source that all contracts are evaluated at runtime, right?
I'm very interested in the possibility of static verification--see the .NET Code Contracts library for one example of this. I ask because if this isn't currently suppported then it's something I'm interested in working on, and I suspect that Nim's AST manipulation features are robust enough to allow it.
The text was updated successfully, but these errors were encountered:
Yes, I know about static verification tools for .NET, JVM and many others, but it's not currently supported by NimContracts. Nim's AST can, of course, give you much information about the code itself, but in itself, it doesn't have much static analysis power (even though compiler does has some). One of the problems is that Nim's macros are written for simplicity rather than providing the user with absolutely every bit of information available, so pretty much the whole engine would need to be written separately or as a serious plug-in to the compiler. In fact, it seems to me it should be an external program to be run on the code rather than just the compiler running checks before compiling... unless you write that program in Nim and provide a macro to run it during compilation.
As for now, I don't really have time to work on a Nim static analysis tool but feel free to use NimContracts for that if you see it fit. I hope to try my best on that one day too.
Anyway: thank you for asking. :) Good to see that there are people actually interested in that topic.
Update: I can see Nim version 1.2 added built-in support for pragmas with almost the same names as the ones used by NimContracts. I think it might be a good point to consider using those, as any external tools can be expected to operate on them.
I'm getting from the readme and skimming the source that all contracts are evaluated at runtime, right?
I'm very interested in the possibility of static verification--see the .NET Code Contracts library for one example of this. I ask because if this isn't currently suppported then it's something I'm interested in working on, and I suspect that Nim's AST manipulation features are robust enough to allow it.
The text was updated successfully, but these errors were encountered: