Date: 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
return n

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.
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID 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.
Account name:
If you don't have an account you can create one now.
HTML doesn't work in the subject.


Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.



April 2013

14151617 181920

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 21st, 2017 03:12 am
Powered by Dreamwidth Studios