Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,790,141 events total
2026-03-23 02:39:55 <geekosaur> that normally is enough, but extra-deps may need additional massaging because they're deliberately overriding stack and stack doesn't have a solver
2026-03-23 02:40:39 <geekosaur> I'm not a stack user and know only basic usage; I don't know how --allow-newer affects it, as distinct from how it affects cabal
2026-03-23 02:43:40 <geekosaur> but I can say that stack is simpler than cabal until you start messing with extra-deps, then it suddenly becomes harder (and much harder as you add extra-deps)
2026-03-23 02:44:18 <geekosaur> but if you have only the one, you may be better off just pinning it to a later version and skipping the --allow-newer
2026-03-23 02:44:32 <haskellbridge> <sm> ohh I'm sorry, I total was. geekosaur and alexfmpe are right but I was not.
2026-03-23 02:47:36 × tremon quits (~tremon@83.80.159.219) (Remote host closed the connection)
2026-03-23 02:48:43 <haskellbridge> <sm> td123 package.yaml isn't required, stack will use the project.cabal file directly otherwise
2026-03-23 02:49:11 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 02:50:24 <geekosaur> stack's package.yaml is just a more convenient way to generate cabal files, which can be significantly more complex to write directly (granting that most people don't need that complexity)
2026-03-23 02:51:42 <haskellbridge> <sm> and yes normally adding a package to build-depends is what's needed to make it importable in ghci. Note, that means ghci as run by "stack ghci" or cabal equivalent, in your project. Not just "ghci" at the command line.
2026-03-23 02:51:43 <geekosaur> also cabal files require you to write some things out fully, which package.yaml lets you abbreviate
2026-03-23 02:53:17 <td123> alright, I relaxed the version bounds for clash-shake so I no longer need --allow-newer for stack build, but I still can't import something like `import RetroClash.Utils` in `stack ghci`
2026-03-23 02:53:52 <haskellbridge> <sm> does "stack exec -- ghc-pkg list | grep retroclash" show it installed ?
2026-03-23 02:54:17 <td123> nope
2026-03-23 02:54:22 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
2026-03-23 02:54:43 <haskellbridge> <sm> is it in the right build-depends list in the .cabal file ? each component can have a different one
2026-03-23 02:55:32 <geekosaur> they said it was building, so presumably it is
2026-03-23 02:55:45 <geekosaur> I don't know how stack ghci deals with multiple components, though
2026-03-23 02:56:44 <haskellbridge> <sm> if "stack build" logged that package being installed successfully, it should be showing up in that ghc-pkg command I would think.
2026-03-23 02:57:02 <td123> stack build works, but it isn't logging that package as being installed, here is my cabal file https://paste.tomsmeding.com/sGAahNdz
2026-03-23 02:57:19 × karenw quits (~karenw@user/karenw) (Ping timeout: 264 seconds)
2026-03-23 02:57:34 <probie> jreicher: you're the one asserting they can expand at runtime. Can you give a minimal example (that doesn't use `eval`, since whilst technically true, it's equally dangerous without macros)
2026-03-23 02:57:46 <haskellbridge> <sm> capitalised Build-Depends in the executable component - is that valid ?
2026-03-23 02:58:24 <geekosaur> yes
2026-03-23 02:58:52 <geekosaur> the Cabal library (actually Cabal-syntax) would be complaining about an invalid cabal file otherwise
2026-03-23 02:59:32 <haskellbridge> <sm> so I hope..
2026-03-23 03:01:53 <geekosaur> https://downloads.haskell.org/~cabal/Cabal-1.0/doc/pkg-spec-html/x611.html#SBI-PKG-DESC
2026-03-23 03:02:40 <geekosaur> this hasn't changed, field names are case independent and always have been
2026-03-23 03:04:32 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 03:04:45 × emmanuelux quits (~em@user/emmanuelux) (Ping timeout: 245 seconds)
2026-03-23 03:05:06 <haskellbridge> <sm> good
2026-03-23 03:05:26 <haskellbridge> <sm> td123 retroclash-lib isn't listed under packages: in stack.yaml is it ? shouldn't be
2026-03-23 03:06:47 emmanuelux joins (~em@user/emmanuelux)
2026-03-23 03:06:50 <td123> It's listed under extra-deps: Here's my stack.yaml and stack.yaml.lock: https://paste.tomsmeding.com/m4q1xjRa
2026-03-23 03:07:37 <haskellbridge> <sm> all looks fine. I am scratching my head too.
2026-03-23 03:08:11 <haskellbridge> <sm> at this point I would be testing with a more minimal .cabal file
2026-03-23 03:09:27 <geekosaur> were it cabal instead of stack I'd be digging at plan.json (probably via cabal-plan, but sometimes I `jq . plan.json | grep …`)
2026-03-23 03:09:28 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 244 seconds)
2026-03-23 03:11:18 <haskellbridge> <sm> does "cabal build --dry-run" look like it would install retroclash-lib ?
2026-03-23 03:11:44 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 265 seconds)
2026-03-23 03:12:00 × machinedgod quits (~machinedg@d172-219-48-230.abhsia.telus.net) (Ping timeout: 246 seconds)
2026-03-23 03:12:21 <haskellbridge> <sm> we would expect it to, and "stack build --dry-run" too
2026-03-23 03:13:14 <jreicher> probie: I'm not sure I understand the challenge/question. Any macro is expanded at runtime, and a human can't tell what the expansion will do without "performing it in their head". So it's statically analysable only in the same way that any (simple) code is; i.e., not really.
2026-03-23 03:13:47 <jreicher> It's not like the C preprocessor which cannot use all of C. A Lisp macro can be arbitrary Lisp code.
2026-03-23 03:16:07 <td123> alright, I think I might be getting somewhere, I created a new project with `stack new test-stack`, added retroclash-lib-0.1.2.3 to extra-deps in stack.yaml, and added it to package.yaml as well to the dependencies and now I'm getting an error: https://paste.tomsmeding.com/85f8ohfe
2026-03-23 03:17:56 <probie> jreicher: so running "hello.lisp" from https://paste.sr.ht/~probie/646187f9483b6d526adf872692b2d7e9b69614dd will output "T\n2\n4", since `some-macro` doesn't depend on the runtime value of `*flag*`
2026-03-23 03:19:32 <probie> The value of `(some-macro *2)` is decided during the macro expansion phase, which is generally considered a distinct thing from "runtime"
2026-03-23 03:21:06 <haskellbridge> <sm> td123 seems reasonable. I might be confused, but: your pastes showed a seven-segment.cabal file, but the stack.yaml's packages list mentions a clash-shake package
2026-03-23 03:21:48 <probie> If you want to perform static analysis on lisp code, you run it after macro-expansion; in the same way you'd do it for Haskell after all Template Haskell has been evaluated
2026-03-23 03:22:35 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 03:22:45 <haskellbridge> <sm> with that stack.yaml file, stack build will build only clash-shake
2026-03-23 03:23:10 puke joins (~puke@user/puke)
2026-03-23 03:23:16 <td123> I think you figured it out, I think I might need a `- .` in there as well huh.
2026-03-23 03:23:26 <haskellbridge> <sm> aha
2026-03-23 03:26:04 <haskellbridge> <sm> significant fog of war :)
2026-03-23 03:27:27 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-03-23 03:27:41 <jreicher> probie: OK, I understand. I regard eager macro-expansion as a compiler optimisation that should be indistinguishable from the behaviour of not having it. And also when I run your code through an interpreter I get different behaviour, but I'm guessing you regard that as invalid since you seem to think the behaviour of "real" compilers is the authority on semantics. And that's OK; just wanted to know where the difference of opinion was.
2026-03-23 03:27:55 <td123> yup that was it, now it's building retroclash-lib! Thanks everyone :)
2026-03-23 03:29:05 <jreicher> This also explains why macro-expansion tools are needed. A human can't do static analysis without "running" the expansion. But you might like to say "compiling" it.
2026-03-23 03:29:43 wickedjargon joins (~user@S0106f89e28d5699a.vc.shawcable.net)
2026-03-23 03:36:52 <probie> jreicher: interesting; what are you running it through?
2026-03-23 03:37:39 <probie> huh, clisp gives me a different result
2026-03-23 03:37:57 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 03:38:42 wickedja` joins (~user@2605:8d80:5430:f3d9:bf96:8d1d:861a:f27)
2026-03-23 03:39:10 × wickedjargon quits (~user@S0106f89e28d5699a.vc.shawcable.net) (Ping timeout: 268 seconds)
2026-03-23 03:42:10 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 248 seconds)
2026-03-23 03:42:37 arandombit joins (~arandombi@user/arandombit)
2026-03-23 03:49:47 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 03:51:14 × td123 quits (~tom@user/td123) (Quit: Konversation terminated!)
2026-03-23 03:52:41 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 248 seconds)
2026-03-23 03:53:55 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-23 03:55:21 × weary-traveler quits (~user@user/user363627) (Quit: Konversation terminated!)
2026-03-23 03:55:34 arandombit joins (~arandombi@user/arandombit)
2026-03-23 03:55:42 weary-traveler joins (~user@user/user363627)
2026-03-23 04:00:37 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 244 seconds)
2026-03-23 04:05:06 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 04:09:45 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 255 seconds)
2026-03-23 04:14:10 Winston joins (~Winston@2001:4958:39f1:1f01:2452:5c2:491d:402f)
2026-03-23 04:15:02 × Winston quits (~Winston@2001:4958:39f1:1f01:2452:5c2:491d:402f) (Client Quit)
2026-03-23 04:20:25 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 04:23:09 Winston joins (~Winston@2001:4958:39f1:1f01:2452:5c2:491d:402f)
2026-03-23 04:24:48 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-03-23 04:35:47 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 04:40:36 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-03-23 04:40:48 × Winston quits (~Winston@2001:4958:39f1:1f01:2452:5c2:491d:402f) (Quit: Client closed)
2026-03-23 04:46:25 arandombit joins (~arandombi@user/arandombit)
2026-03-23 04:51:09 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 04:51:46 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 244 seconds)
2026-03-23 04:57:40 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-23 05:00:16 × lbseale quits (~quassel@user/ep1ctetus) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2026-03-23 05:03:57 arandombit joins (~arandombi@user/arandombit)
2026-03-23 05:05:38 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2026-03-23 05:06:02 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
2026-03-23 05:06:23 × puke quits (~puke@user/puke) (Remote host closed the connection)
2026-03-23 05:07:12 puke joins (~puke@user/puke)
2026-03-23 05:09:12 merijn joins (~merijn@host-cl.cgnat-g.v4.dfn.nl)
2026-03-23 05:11:03 × arandombit quits (~arandombi@user/arandombit) (Ping timeout: 272 seconds)
2026-03-23 05:13:30 × merijn quits (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-03-23 05:15:35 michalz joins (~michalz@185.246.207.200)
2026-03-23 05:17:10 <jreicher> probie: I just used ielm because it's right in front of me. Good enough for this example I think even though you might not consider it a "real" lisp environment. (And I probably wouldn't argue with that.)

All times are in UTC.