Skip to content

Introduce safety modes #180

@FedericoCeratto

Description

@FedericoCeratto

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions