M
Modular4mo ago
AM

effects system?

Does the team have a position on this: https://github.com/modularml/mojo/discussions/783 These things are quite helpful also for safe automatic parallelism (see dex and jax)
GitHub
Is an effect system (e.g. like Nim language) being considered? · mo...
Nim language has generalized exception tracking through use of effect system (https://nim-lang.org/docs/manual.html#effect-system). Though it need not be on the initial roadmap, it would be great i...
2 Replies
sora
sora4mo ago
IIRC, there is also discussion about adding effects to MLIR. Mojo may hook directly into that if that ever happens.
Nick!
Nick!4mo ago
Different people mean different things when they say “effect system”. In your mind, what does an effect system do, and how would it improve Mojo? Mojo already tracks exceptions in function signatures. It also tracks some kinds of mutation (argument mutation), and it will track additional kinds of mutation once references are finalized. I/O can be modelled as reading and/or mutating a data source, so IMO it falls into the “tracking mutation” bucket.