Create a Dreamwidth Account
Site and Account
Reload page in style:
2013-04-19 02:30 am (UTC)
Ah, but I do plan on handling state in the type system! I just don't want to force the user to write it in too many places. I don't know how this will work exactly, but one possibility is that the function
def fact n = 120
will be treated as pure, the function
local n : int
def foo () = return n + 1
will be treated as in the reader monad, and the function
local mut n : int
def incr () =
n := n + 1
will be treated as in the state monad. If the programmer wants, they can explicitly annotate this somehow, but my goal is to make it so you only have to write things once, and it should be in the most intuitive way possible. This raises issues of compositionality, but that's just a matter of finding a syntax and set of commands that work.
The idea isn't to create a radically new semantics (though I think there is some new work to be done), or to regress back to something less well-verified; the point is to take the good abstractions that we already have and make them palatable to people who don't already live and breathe this stuff, because, well, not everybody does, or can, or even wants to. Ideally, someone will be able to come in, hack out some code like they normally would in Python, and think about it in the way that's most intuitive to them instead of having to adapt to this bizarre points-free style that's required for 2/3 of the big three monads. Then, once they've written it, they can incrementally get more and more assurances from the type system, at their leisure, or push it off to someone else to take care of.
Thread from start
This account has disabled anonymous posting.
You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address.
Sign in using OpenID
If you don't have an account you can
create one now
HTML doesn't work in the subject.
Check spelling during preview
This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.
Expand Cut Tags
No cut tags
Page generated Jun. 26th, 2017 08:37 am
Top of page