zmv has quit [Read error: Connection reset by peer]
thallada has quit [Ping timeout: 246 seconds]
thallada has joined #racket
DGASAU has quit [Ping timeout: 246 seconds]
thallada has quit [Ping timeout: 244 seconds]
Lowl3v3l has quit [Remote host closed the connection]
thallada has joined #racket
Falacer has joined #racket
Lowl3v3l has joined #racket
thallada has quit [Ping timeout: 272 seconds]
thallada has joined #racket
DGASAU has joined #racket
thallada has quit [Ping timeout: 240 seconds]
zmt01 has joined #racket
zmt00 has quit [Ping timeout: 240 seconds]
longshi has joined #racket
thallada has joined #racket
thallada has quit [Ping timeout: 268 seconds]
thallada has joined #racket
thallada has quit [Ping timeout: 240 seconds]
thallada has joined #racket
thallada has quit [Ping timeout: 250 seconds]
p4bl0 has joined #racket
YuGiOhJCJ has joined #racket
tonyg has joined #racket
thallada has joined #racket
longshi has quit [Quit: WeeChat 2.3]
ubLIX has joined #racket
dddddd has joined #racket
jao has joined #racket
widp_ has joined #racket
jcowan has quit [Quit: Connection closed for inactivity]
shakdwipeea has joined #racket
jcowan has joined #racket
<p4bl0>
Hello all :), I'm trying to play with Typed Racket, and I have a few questions. First, is there a typed version of racket/match? The closest thing I find to what I'm looking for is this https://pkgs.racket-lang.org/package/datatype but it is not as powerful as what I'm expecting (which is something similar to OCaml's match)
<p4bl0>
Another question I have is about the parser tools. How would one write lexer and parser that are statically type checked?
<bremner>
you can use match in typed/racket code. I'm not sure what complications there are.
Lowl3v3l has quit [Remote host closed the connection]
<p4bl0>
bremner: right, but it does not check for completeness of the cases
endformationage has joined #racket
jasonszhao has quit [Ping timeout: 250 seconds]
pierpal has joined #racket
acarrico has quit [Ping timeout: 240 seconds]
acarrico has joined #racket
ubLIX has quit [Quit: ubLIX]
pera has joined #racket
jasonszhao has joined #racket
jasonszhao has quit [Ping timeout: 250 seconds]
<rain1>
how would i make a s-expression where you can click on a symbol in it and that part expands?
<bremner>
p4bl0: OK, but then you'd be matching against some more structured type than just an S-expression. I guess I don't know enough about OCaml to know what's missing from type-case
meepdeew has quit [Remote host closed the connection]
FreeFull has joined #racket
jasonszhao has joined #racket
m1dnight_ has quit [Ping timeout: 252 seconds]
sauvin has quit [Remote host closed the connection]
<p4bl0>
bremner: yes match already does more than matching on the structure of s-exp, but it does not ensure completeness of the covered cases, even in Typed Racket where the type of the expression being matched is known
YuGiOhJCJ has joined #racket
<p4bl0>
bremner: I will look into the plait language, thanks :)
jasonszhao has quit [Ping timeout: 246 seconds]
<bremner>
p4bl0: there's also Hackett, which might be more "serious" than plait, and has some pattern matching forms
zmt01 is now known as zmt00
<bremner>
lexi-lambda can reject my accusation of seriousness ;)
<p4bl0>
bremner: right, but hackett is quite different from Racket/Scheme (lazyness etc)
<bremner>
yes
<p4bl0>
what I would really like is typed/parser-tools
<p4bl0>
but maybe I should just use OCaml
<bremner>
maybe ;)
<bremner>
my impression is that algebraic data types are not really idiomatic in typed/racket. I have mainly used the teaching languages where ADTs are added, but I guess the idomatic thing to do in typed/racket is occurance typing.
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
<p4bl0>
if I understand correctly what is occurrence typing, it is quite flexible and powerful to statically ensure what a function returns, but not that it exhaustively accepts all members of its input type
<p4bl0>
but plait seems interresting :)
<p4bl0>
there is still the issue of having typed lexers and parsers, but again, maybe if I want to have OCaml I should just use OCaml ^^
Lowl3v3l has joined #racket
pera has quit [Ping timeout: 250 seconds]
pera has joined #racket
audriu has quit [Quit: Leaving]
Fernando-Basso has joined #racket
Lowl3v3l has quit [Quit: Leaving.]
Falacer has quit [Ping timeout: 246 seconds]
Falacer has joined #racket
Falacer has quit [Ping timeout: 240 seconds]
cantstanya has quit [Remote host closed the connection]
<lexi-lambda>
p4bl0: If it’s laziness that turns you away, I’m probably going to drop laziness in Hackett and just make the language strict. But that doesn’t change the fact that Hackett isn’t really practically useful right now, so that doesn’t help you very much.
Falacer has joined #racket
keep_learning has quit [Quit: Ping timeout (120 seconds)]
Falacer_ has joined #racket
<aeth>
lexi-lambda: Imo not being lazy is probably a good idea, unless the point is to be lazy.
Falacer has quit [Ping timeout: 272 seconds]
Falacer_ has quit [Ping timeout: 244 seconds]
cantstanya has joined #racket
ng0 has joined #racket
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #racket
orivej_ has joined #racket
orivej has quit [Ping timeout: 240 seconds]
<jcowan>
lexi-lambda: I'm glad to hear that. Pervasive laziness is to ensure purity, but a system designed *uno animo* can just be pure and not worry about it.
meepdeew has joined #racket
Falacer has joined #racket
<lexi-lambda>
Pervasive laziness is appealing for a variety of reasons. Awkward nullary functions mostly go away. You get some benefits that are hard to recover with opt-in laziness. And as SPJ says, it “keeps you honest”—it means you can’t really break purity in a predictable way, so people don’t try.
<lexi-lambda>
And with a good strictness analyzer and a runtime optimized for laziness, it can even be reasonably efficient. But the former is a lot of work, and the latter does not seem like something Racket will ever have.
<lexi-lambda>
And even with those things, there are a lot of other drawbacks. So it seems pragmatic to give up on laziness, even if it makes me sad to give up some of its benefits.
YuGiOhJCJ has joined #racket
Sgeo__ has joined #racket
orivej_ has quit [Ping timeout: 250 seconds]
orivej has joined #racket
jasonszhao has joined #racket
Sgeo_ has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 246 seconds]
Falacer has quit [Ping timeout: 245 seconds]
jasonszhao has quit [Ping timeout: 246 seconds]
<jcowan>
Well, if you do not like crottle greeps (or nullary functions), do not provide them.
<jcowan>
Also, I have little faith in strictness analyzers: they are inevitably going to be too conservative. (For that matter, static typing itself is often too conservative, as the cool example of Dialyzer, the type checker for Erlang, shows.)
Fernando-Basso has quit [Remote host closed the connection]