mazeppa-dev / mazeppa

A modern supercompiler for call-by-value functional languages
MIT License
366 stars 6 forks source link

Evaluation of built-in panics shouldn't raise an exception #22

Closed Hirrolot closed 1 month ago

Hirrolot commented 1 month ago

Consider the following program:

main() := /(5i32, 0i32);

When evaluated:

error: Cannot reduce: `Panic("out of range: `/(5i32, 0i32)`")`

However, according to the language semantics, the result of evaluation must be Panic(s), where s is an implementation-defined string constant:

Panic("out of range: `/(5i32, 0i32)`")

This also affects our library API.