-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Effect systems #172
Comments
Effects are not something I had considered. I am aware of the Flix programming language (https://flix.dev/) which has a "polymorphic effect system". Flix has a similar goal to Morel - integrating relational algebra and datalog into a functional programming language - but I think that effects are somewhat orthogonal to relational algebra. It's possible that there are major problems in Morel that can be solved by effects. I have not thought very much about eager vs lazy, for instance. I have also not thought much about provable termination. I don't see any problems with 'where queries can happen in the code and what code can happen inside a query'. A |
Interesting, I did not know about Flix. I will read up on it. Thanks 👍
I meant, for example, if one of the expressions inside a query clause contains imperative code, such as mutating a reference, it would probably make it impossible to optimize the query without changing its behavior. |
Ah, I see. Yes, there several differences in assumptions between functional programs and SQL:
I can see how effects systems could bridge between those differences. But before introducing effects, I'd like to see how far we can get staying within a pure, eager, strongly typed language with polymorphism and an assumption that the compiler aggressively inlines expressions. |
Interesting list. Will Morel provide syntax for With effects, I meant only that they can be a solution to to verify such rules. I am not so interested in the "effect handlers" that some languages are hyping up right now 😅 |
SQL There could be a Also, at some point we will allow UDFs written in Java, so of course you could write an impure random function. SQL's |
Have you thought about adding an effect system to Morel?
It requires some extensions to SML, but I think it could solve problems related to restricting where queries can happen in the code and what code can happen inside a query.
The text was updated successfully, but these errors were encountered: