Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,790,349 events total
2026-03-15 21:28:30 <jreicher> PN is particularly nice in FP (IMO). The operators can be curried, so if you see a number, pop the function at the top, apply it to the number, and push.
2026-03-15 21:28:58 <tomsmeding> and loop
2026-03-15 21:29:03 <tomsmeding> you don't need to loop with RPN
2026-03-15 21:29:14 <tomsmeding> (I'm digging for arguments here)
2026-03-15 21:29:24 <jreicher> You need an input loop for both.
2026-03-15 21:29:41 <tomsmeding> yeah, but with PN, a single input symbol may trigger an unbounded number of stack operations, right?
2026-03-15 21:30:47 <jreicher> Yes. You do need to check if the result of the application is another (curried) operator or a number. If it's a number then you do something else. But I'm not sure that's very different from checking the type of the next token on input.
2026-03-15 21:31:07 <tomsmeding> you have a nested loop instead of a single loop
2026-03-15 21:31:26 <tomsmeding> I'm not sure if this makes it "significantly" more complicated. I'm playing devil's advocate here a little. But it's a difference at least
2026-03-15 21:32:15 <jreicher> I see what you mean. I wonder if it's possible to do it with a single loop. My hunch is it is.
2026-03-15 21:33:23 <haskellbridge> <ijouw> Do you mean you can unify the loops (definitly) or use a different algorithm with only input loop?
2026-03-15 21:33:25 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
2026-03-15 21:34:01 <jreicher> Both, actually. I was just thinking this might be a nice way of teaching tail calls. If the result of the operator application is a number, recurse to another application.
2026-03-15 21:34:06 <jreicher> (with a pop)
2026-03-15 21:35:16 <jreicher> It kind of makes explicit that stack of continuations that are in the Haskell runtime. Also perhaps a nice way of teaching that concept.
2026-03-15 21:36:33 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 21:38:33 humasect joins (~humasect@dyn-192-249-132-90.nexicom.net)
2026-03-15 21:43:38 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2026-03-15 21:44:24 hakutaku joins (~textual@user/hakutaku)
2026-03-15 21:49:14 × qqq quits (~qqq@185.54.20.215) (Remote host closed the connection)
2026-03-15 21:54:37 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 21:58:47 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-03-15 21:59:34 × michalz quits (~michalz@185.246.207.193) (Remote host closed the connection)
2026-03-15 22:01:35 <tomsmeding> jreicher: I'm with you, but I think we can agree that having to introduce the idea of tail calls in order to achieve a single loop is more complicated than RPN's... single loop
2026-03-15 22:02:51 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2026-03-15 22:03:14 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
2026-03-15 22:09:58 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 22:10:34 <jreicher> I'm not sure. I'm inclined to think it depends on the programmer's mental model of runtime, and that PN is the functional way and RPN is the imperative way. So the latter is easier if you presuppose an imperative mental model, but should we...? (I'm not sure I can argue this hunch, but I feel it strongly; it's the control stack vs data stack)
2026-03-15 22:11:28 <mesaoptimizer> https://coalton-lang.github.io/20260312-coalton0p2/ coalton is now less Haskell and more common lisp than before
2026-03-15 22:11:52 <jreicher> A possible argument might run like this. The most "optimal" way to evaluate a long sum (for example) is RPN, because the expression can be held outside the program (on input) while evaluation is being done. But this "relies" on the effectful nature of the world.
2026-03-15 22:14:17 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-03-15 22:24:54 <EvanR> that sounds more like streaming is more efficient than buffering, rather than a prefix postfix thing
2026-03-15 22:25:10 weary-traveler joins (~user@user/user363627)
2026-03-15 22:25:21 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 22:25:36 <jreicher> Yes, with the (predictable?) observation that only postfix can be streamed.
2026-03-15 22:26:05 <EvanR> this sounds very mixing up levels of abstraction. RPN is a notation not an implementation backend
2026-03-15 22:26:17 <EvanR> syntax vs (operational) semantics
2026-03-15 22:26:36 <EvanR> with the bridge being a compiler as usual
2026-03-15 22:26:49 <jreicher> I know. But I'm asking why RPN is a preferred example for an "implementation of something". I think the nature of that question mixes things, necessarily.
2026-03-15 22:29:23 <EvanR> ok a calculator based on RPN is like a combination of programming language and UI in one
2026-03-15 22:30:00 <EvanR> I guess it's simple enough there's not much room for philosophizing
2026-03-15 22:30:19 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-15 22:32:09 <Rembane> Also, stacks are neat!
2026-03-15 22:37:19 craunts795335385 joins (~craunts@152.32.99.2)
2026-03-15 22:40:43 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 22:42:31 × craunts795335385 quits (~craunts@152.32.99.2) (Ping timeout: 268 seconds)
2026-03-15 22:45:19 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-15 22:49:31 × euphores quits (~SASL_euph@user/euphores) (Ping timeout: 264 seconds)
2026-03-15 22:56:04 euphores joins (~SASL_euph@user/euphores)
2026-03-15 22:56:06 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 23:00:47 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2026-03-15 23:03:17 <monochrom> Nice, so PN induces a great question for amortized time!
2026-03-15 23:04:35 <jreicher> Not following, and I want to!
2026-03-15 23:04:52 <EvanR> PN becomes more efficient if your code uses right to left language
2026-03-15 23:05:38 × st_aldini quits (~Betterbir@136.48.46.187) (Quit: st_aldini)
2026-03-15 23:05:49 <monochrom> A single input symbol may trigger an unbounded number of stack pops. This is a great recipe for disaster^W intresting amortized time!
2026-03-15 23:06:43 <jreicher> You mean RPN can be amortized and PN can't?
2026-03-15 23:06:48 <monochrom> PN.
2026-03-15 23:07:17 <jreicher> I'm missing something that's probably obvious, sorry. :) I think I need you to spell it out.
2026-03-15 23:08:45 <jreicher> Do you mean the question induced is what is the amortized time?
2026-03-15 23:09:08 <monochrom> The basic amortization example is a stack whose API has push, pop, multipop(n). multipop(n) worst case time is Ω(n), but amortized time stays O(1).
2026-03-15 23:09:29 <jreicher> Yep, I got you. :) Phew. And I agree, that's nice.
2026-03-15 23:09:36 <monochrom> PN is then just bells and whistles dressing up that stack API.
2026-03-15 23:09:53 <jreicher> And easily understandable bells and whistles, which is why it might be a good example.
2026-03-15 23:11:29 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 23:14:02 × dolio quits (~dolio@130.44.140.168) (Quit: ZNC 1.10.1 - https://znc.in)
2026-03-15 23:18:10 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-03-15 23:20:32 dolio joins (~dolio@130.44.140.168)
2026-03-15 23:22:16 Guest24 joins (~Guest24@94.42.242.59)
2026-03-15 23:25:15 xff0x_ joins (~xff0x@2405:6580:b080:900:1fdc:c04d:3012:9e4)
2026-03-15 23:26:37 × xff0x quits (~xff0x@2405:6580:b080:900:e24f:1ef:ed48:3e20) (Ping timeout: 244 seconds)
2026-03-15 23:29:31 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 23:34:00 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-15 23:35:22 × gabiruh quits (~gabiruh@vps19177.publiccloud.com.br) (Quit: ZNC 1.7.5 - https://znc.in)
2026-03-15 23:35:50 gabiruh joins (~gabiruh@vps19177.publiccloud.com.br)
2026-03-15 23:44:53 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-15 23:49:30 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2026-03-15 23:50:47 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 258 seconds)
2026-03-15 23:56:41 wickedjargon joins (~user@S0106ac17c8c20e24.vc.shawcable.net)
2026-03-16 00:00:23 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-16 00:01:45 st_aldini joins (~Betterbir@136.48.46.187)
2026-03-16 00:04:45 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-03-16 00:15:42 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-16 00:16:56 pavonia joins (~user@user/siracusa)
2026-03-16 00:20:15 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-03-16 00:25:22 × Tuplanolla quits (~Tuplanoll@88-114-89-88.elisa-laajakaista.fi) (Ping timeout: 248 seconds)
2026-03-16 00:25:26 × Guest24 quits (~Guest24@94.42.242.59) (Quit: Client closed)
2026-03-16 00:31:02 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-16 00:35:48 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-03-16 00:40:53 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
2026-03-16 00:45:51 × wickedjargon quits (~user@S0106ac17c8c20e24.vc.shawcable.net) (Remote host closed the connection)
2026-03-16 00:46:25 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-16 00:50:57 peterbecich joins (~Thunderbi@71.84.33.135)
2026-03-16 00:53:05 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-16 01:01:23 × xff0x_ quits (~xff0x@2405:6580:b080:900:1fdc:c04d:3012:9e4) (Ping timeout: 272 seconds)
2026-03-16 01:04:28 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-16 01:08:56 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
2026-03-16 01:19:49 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-16 01:24:36 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-03-16 01:30:35 × acidjnk_new3 quits (~acidjnk@p200300d6e700e515b93fdf75026bf1fc.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)

All times are in UTC.