2026/06/08

Newest at the top

2026-06-08 14:30:52 +0000CloneOfNone_(~CloneOfNo@user/CloneOfNone) (Ping timeout: 265 seconds)
2026-06-08 14:30:12 +0000weary-traveler(~user@user/user363627) user363627
2026-06-08 14:29:58 +0000CloneOfNone(~CloneOfNo@user/CloneOfNone) CloneOfNone
2026-06-08 14:29:56 +0000weary-traveler(~user@user/user363627) (Quit: Konversation terminated!)
2026-06-08 14:27:45 +0000 <ski> and yea, the monadic result value of `main' is ignored, so that `undefined' is never evaluated
2026-06-08 14:27:09 +0000 <ski> janus : after evaluation to WHNF, it executes the resulting `IO'-action, which may in turn trigger further execution (and dependent evaluation)
2026-06-08 14:26:13 +0000 <janus> and i run that program, i see "hi" but no exception
2026-06-08 14:26:00 +0000 <janus> if i do echo -e 'import Debug.Trace ; main = traceM "hi" >>= \() -> pure undefined' > /tmp/B.hs
2026-06-08 14:25:49 +0000 <janus> ski: how would it ever get beyond the first line of the 'do' notation the 'main' definition if it stops at the first >>=?
2026-06-08 14:25:36 +0000machinedgod(~machinedg@d172-219-48-230.abhsia.telus.net) machinedgod
2026-06-08 14:24:29 +0000xff0x(~xff0x@2405:6580:b080:900:7bda:8dd9:d259:e21b) (Ping timeout: 245 seconds)
2026-06-08 14:23:38 +0000gehmehgehgmg
2026-06-08 14:20:34 +0000chromoblob(~chromoblo@user/chromob1ot1c) chromoblob\0
2026-06-08 14:20:06 +0000chromoblob(~chromoblo@user/chromob1ot1c) (Read error: Connection reset by peer)
2026-06-08 14:19:01 +0000gmg(~user@user/gehmehgeh) (Ping timeout: 245 seconds)
2026-06-08 14:17:11 +0000gehmehgeh(~user@user/gehmehgeh) gehmehgeh
2026-06-08 14:12:15 +0000xff0x(~xff0x@2405:6580:b080:900:7bda:8dd9:d259:e21b)
2026-06-08 14:11:00 +0000 <ski> janus : "is evaluated until the last `pure`" -- not really. it would also stop at a `(>>=)'
2026-06-08 14:10:40 +0000epolanski(uid312403@id-312403.helmsley.irccloud.com) epolanski
2026-06-08 14:08:49 +0000ystael(~ystael@user/ystael) ystael
2026-06-08 14:07:05 +0000rekahsoft(~rekahsoft@2605:8d80:1520:40b8:7f13:d56c:3912:7b7a) (Ping timeout: 248 seconds)
2026-06-08 14:03:31 +0000 <janus> i suppose i could make an STGi program with a tuple construction, and then it shouldn't ever evaluated the 'a' thunk
2026-06-08 14:02:20 +0000 <janus> comerijn: ok, and 'pure' corresponds to the tuple constructor? because it crashes if the tuple is undefined, but it doesn't crash if the 'a' is undefined...
2026-06-08 13:57:46 +0000 <comerijn> janus: So at the STG level running IO/main is just a matter of "pass an argument, force the resulting tuple"
2026-06-08 13:57:21 +0000 <comerijn> janus: At the STG level `IO a` is just a function `RealWorld# -> (a, RealWorld#)` (where `RealWorld#` is a builtin in the compiler)
2026-06-08 13:52:57 +0000 <comerijn> i.e., that's the RTS' purview which is not constrained by the language definition
2026-06-08 13:52:43 +0000 <comerijn> janus: The evaluation of main is (conceptually) external to your code, though
2026-06-08 13:52:15 +0000xff0x(~xff0x@ai070051.d.east.v6connect.net) (Quit: xff0x)
2026-06-08 13:47:06 +0000tnt1(~Thunderbi@user/tnt1) tnt1
2026-06-08 13:45:21 +0000ouilemur(~jgmerritt@user/ouilemur) ouilemur
2026-06-08 13:41:07 +0000 <janus> probably not entirely true because as written, main is also evaluted even though it has no case
2026-06-08 13:39:59 +0000TwinAdam(~TwinAdam@user/adamsaunders) adamsaunders
2026-06-08 13:39:59 +0000 <janus> oh, the readme does say "Note that the WHNF part makes case strict, and indeed it is the only construct that does evaluation."
2026-06-08 13:38:43 +0000TwinAdam(~TwinAdam@user/adamsaunders) (Ping timeout: 264 seconds)
2026-06-08 13:34:01 +0000__monty__(~toonn@user/toonn) toonn
2026-06-08 13:31:49 +0000__monty__(~toonn@user/toonn) (Ping timeout: 244 seconds)
2026-06-08 13:27:44 +0000rekahsoft(~rekahsoft@2605:8d80:1520:40b8:7f13:d56c:3912:7b7a) rekahsoft
2026-06-08 13:27:07 +0000 <janus> s/teach/handle/
2026-06-08 13:25:37 +0000Inline(~noOne@ipservice-092-208-182-236.092.208.pools.vodafone-ip.de) Inline
2026-06-08 13:24:32 +0000 <janus> Right ok. So since STGi doesn't have any special monad handling, it has to teach main differently. And it just decides to evaluates main to WHNF even though that is not applicable to GHC's main
2026-06-08 13:22:50 +0000 <janus> This also shows the difference with simply `undefined` at the end since that _does_ crash
2026-06-08 13:21:49 +0000 <janus> hmm, so I suppose main with type `IO a` is evaluated until the last `pure`, but that `a` is not necessarily evaluated. Because I can do `pure undefined` without having it crash at runtime
2026-06-08 13:17:35 +0000DetourNe-DetourNetworkUK
2026-06-08 13:15:40 +0000DetourNetworkUK(~DetourNet@user/DetourNetworkUK) (Read error: Connection reset by peer)
2026-06-08 13:15:22 +0000DetourNe-(~DetourNet@user/DetourNetworkUK) DetourNetworkUK
2026-06-08 13:12:35 +0000 <ski> (also, `main' has type `IO a', for any `a' you like)
2026-06-08 13:12:14 +0000 <ski> `return undefined' is different from `undefined'
2026-06-08 13:08:54 +0000 <janus> maybe 'main' is a bit different in STGi in that it can be evaluated to WHNF while in Haskell i don't even know if it makes sense to talk about WHNF of 'IO ()'
2026-06-08 13:02:44 +0000 <janus> i've seen that that Case always only matches on the outer level, so if main is an Int#, i suppose it has to get evaluated to 3# because anything else wouldn't be a constructor of Int#
2026-06-08 13:01:13 +0000 <janus> i suppose i am just wondering why, in a pure lazy language, there needs to be a difference between Case and Eval