2025/03/17

Newest at the top

2025-03-17 18:42:27 +0100 <ski> (as opposed to explicitly spelling out your recursions, which (in case of tail recursion at least), amount to the same as programming with `goto's, apart from that you can pass parameters)
2025-03-17 18:41:32 +0100 <ski> a macro for, more composably, doing loops, yes, EvanR
2025-03-17 18:40:26 +0100 <ski> (the "types" here would be the "contexts"/"syntactic categories", like "expression","type","pattern","loop clause",&c.)
2025-03-17 18:39:34 +0100skiwould like to have typed macros, to be able to have them by-value, rather than by-name (being able to introduce macros for sub-languages implemented by DSL macros, without having to explicitly make your DSL macros integrate with these macro definitions)
2025-03-17 18:38:55 +0100 <EvanR> is a loop macro... a macro for doing loops
2025-03-17 18:37:29 +0100 <ski> this is also related to list comprehensions (e.g. <https://srfi.schemers.org/srfi-42/srfi-42.html>), or the (do)/2 construct in ECLiPSe Prolog <https://eclipseclp.org/doc/tutorial/tutorial025.html>,<https://eclipseclp.org/doc/userman/umsroot023.html>, or enumerators / internal iteration vs. cursors / external iteration <https://okmij.org/ftp/papers/LL3-collections-enumerators.txt>
2025-03-17 18:37:04 +0100 <ski> "Yow! LOOP macros are LOOPY!" by foof in 2006-09-06 at <https://groups.google.com/g/comp.lang.scheme/c/DLkZdLw1qGw> is also relevant. (foof is the author of a similar, but not quite identical, looping macro package, named `loopy-loop' <https://wiki.call-cc.org/eggref/4/loopy-loop>, as opposed to `foof-loop' by Riastradh <https://wiki.call-cc.org/eggref/4/loopy-loop>)
2025-03-17 18:35:52 +0100 <mauke> and there's streaming and lenses involved
2025-03-17 18:35:47 +0100 <haskellbridge> <Liamzee> i spent an hour (and it's my fault) trying to figure out why a HTML sample in Lucid2 was angering GHC
2025-03-17 18:35:22 +0100 <mauke> now imagine print (2 + 2), but instead of adding numbers, it fetches data over HTTP (path and parameters specified at the type level), which is implicitly decoded as CSV, whose format is again specified at the type level
2025-03-17 18:35:07 +0100 <haskellbridge> <Liamzee> iirc now custom type error messages are a thing, but i think part of. the problem with that is that it's hard to anticipate what type errors will result and figure out how to write the error messages for them are
2025-03-17 18:33:53 +0100 <mauke> no one writes (print :: Integer -> IO ()) (((+) :: Integer -> Integer -> Integer) (2 :: Integer) (2 :: Integer) :: Integer) :: IO ()
2025-03-17 18:33:05 +0100ash3en(~Thunderbi@ip1f10cbd6.dynamic.kabel-deutschland.de) (Client Quit)
2025-03-17 18:32:56 +0100 <EvanR> invisible types?
2025-03-17 18:32:20 +0100 <mauke> it's also pretty bad if half of your code is fairly generic functions and all the semantics are at the (invisible) type level
2025-03-17 18:31:54 +0100ash3en(~Thunderbi@ip1f10cbd6.dynamic.kabel-deutschland.de) ash3en
2025-03-17 18:31:13 +0100 <c_wraith> see https://hackage.haskell.org/package/BASIC
2025-03-17 18:29:59 +0100 <c_wraith> the worst abuses in Haskell are when everything is in a lawless class that happens to work magically until you edit something and then inference fails
2025-03-17 18:29:26 +0100 <haskellbridge> <Liamzee> but then again, I'm a pointfree addict, so I have no right to talk
2025-03-17 18:29:16 +0100 <c_wraith> types at least provide some context.
2025-03-17 18:29:14 +0100lxsameer(~lxsameer@Serene/lxsameer) (Ping timeout: 268 seconds)
2025-03-17 18:28:22 +0100 <haskellbridge> <Liamzee> %s/FP/typed FP
2025-03-17 18:27:49 +0100 <haskellbridge> <Liamzee> it's not my criticism, it's just something I picked up from HN; and looking at some older and poorer Haskell codebases, Haskell can suffer from eDSL disease. The important thing is to know it exists and actively attempt to avoid it, and it's easier to do with FP than with more powerful, untyped macros
2025-03-17 18:27:41 +0100 <EvanR> or maybe the DSLs that appear are just saner
2025-03-17 18:26:03 +0100 <EvanR> do DSLs in haskell avoid Liamzee's criticism because there's a common point of contact usually, the idiomatic haskell types
2025-03-17 18:24:19 +0100 <c_wraith> oh. because it's two links and I'm trying to paste both at once
2025-03-17 18:24:07 +0100 <mauke> (do ((list list (cdr list)) ö_ö
2025-03-17 18:23:54 +0100 <c_wraith> ski: that first link seems to be a 404
2025-03-17 18:23:48 +0100 <EvanR> c_wraith, I can sympathize with equivocating between the choice of function call or macro call, because it seems to achieve the same purpose, and even after all this time I don't instantly see all the differences xD
2025-03-17 18:23:16 +0100merijn(~merijn@77.242.116.146) (Ping timeout: 272 seconds)
2025-03-17 18:22:32 +0100 <ski> `foof-loop' is much more "Lispy", than the `loop' in Common Lisp, which could be argued to be "anti-Lispy"
2025-03-17 18:21:59 +0100 <ski> but yea, re `loop', see "foof-loop: A Simple, Extensible Scheme Looping Facility" by Riastradh at <https://mumble.net/~campbell/scheme/foof-loop.txt>,<https://mumble.net/~campbell/scheme/foof-loop.scm>, which was inpired by "The Anatomy of a Loop: A Story of Scope and Control" by Olin Shivers in 2005-09 at <https://www.ccs.neu.edu/home/shivers/citations.html#loop>
2025-03-17 18:21:36 +0100 <c_wraith> that's exactly using macros as functions
2025-03-17 18:21:12 +0100 <EvanR> what do you mean "old" xD
2025-03-17 18:20:48 +0100 <EvanR> yes
2025-03-17 18:20:30 +0100 <c_wraith> EvanR: have you never seen old C codebases that use #define for functions because they don't trust the compiler to inline?
2025-03-17 18:20:15 +0100 <EvanR> assuming purity, are they both like beta reduction
2025-03-17 18:20:10 +0100 <haskellbridge> <Bowuigi> That's the reason Lisp could get away with clever macros without more recent staging setup
2025-03-17 18:20:06 +0100euleritian(~euleritia@95.90.214.149)
2025-03-17 18:19:33 +0100 <haskellbridge> <Bowuigi> Aren't list/apply semantics the point of lisp?
2025-03-17 18:19:32 +0100 <EvanR> like there is overlap in the ideas somehow
2025-03-17 18:19:31 +0100euleritian(~euleritia@95.90.214.149) (Read error: Connection reset by peer)
2025-03-17 18:19:23 +0100 <EvanR> that sometimes a macro would work when a function would work is interesting to me
2025-03-17 18:18:57 +0100skiwould dispute the antecedent of the implication
2025-03-17 18:18:03 +0100Googulator(~Googulato@2a01-036d-0106-4b74-b88c-ff83-9891-e272.pool6.digikabel.hu)
2025-03-17 18:17:54 +0100 <c_wraith> I think a better criticism is the loop macro's existence
2025-03-17 18:17:48 +0100Googulator(~Googulato@2a01-036d-0106-4b74-b88c-ff83-9891-e272.pool6.digikabel.hu) (Quit: Client closed)
2025-03-17 18:17:47 +0100 <haskellbridge> <Liamzee> if ergonomic macros are the point of lisp, it's a very bad sign when lisp programmers state "never use a macro when a function will do"
2025-03-17 18:17:31 +0100acidjnk(~acidjnk@p200300d6e71c4f06a07cb2b65789c630.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
2025-03-17 18:16:59 +0100 <haskellbridge> <Liamzee> the criticism i read was that abuse of macros leads to dsl / edsl disease, where the codebase is too tightly coupled to its developers