-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
Description
For some classes of applications safety, security and the ability to recover from exceptions and bugs are important. Nim could implement a safety option that:
- enables
--checks:on - enables
--assertions:on - enables
--lineTrace:on(and therefore stackTrace) - guarantees that any checked runtime error results in a catchable exception (see https://forum.nim-lang.org/t/5784)
- depending on the option e.g.
safety:3, refuse to compile procs that use unsafe operations and inline asm (unless specifically tagged as safe?) - pass extra sanitization flags to compilers and linkers as needed
- refuses to compile with any risky experimental features enabled
- enables any safety check that might be added to stdlib in future (e.g.
when defined(safety): ...)
Related:
- https://nim-lang.org/docs/manual.html#definitions
- "Nim is unsafe" Nim is unsafe #4
- @Araq mentioned introducing -d:safety in Enabling some runtime checks in release mode Nim#2809 (comment)
Reactions are currently unavailable