lgarithm / crystalnet

crystalnet -- a mini core AI library (being refactored, see https://github.com/lgarithm/stdnn-ops)
MIT License
16 stars 3 forks source link

use std exceptions or c++20 contract for runtime errors #57

Open lgarithm opened 6 years ago

lgarithm commented 6 years ago
lgarithm commented 6 years ago

Currently std::invalid_argument should be sufficient for our use case.

lgarithm commented 6 years ago

We should limit the usage of exception in the phase of building logical model, which would trigger a fast fail.

To archive this, we might need to introduce two kinds of context, one allows throwing exception, and one doesn't. (This sounds like the IO monad in Haskell).

lgarithm commented 5 years ago

should use c++20 contract when it is available