IRC channel logs

2023-01-21.log

back to list of logs

<akirakyle>a kinda funny question, but does anyone here know how "define" gets defined? Even broadly where in the guile source code I should be looking would be helpful
<dokma>I'm also on the quest to read the Guile source code but haven't started yet.
<dokma>Maybe grepping something like 'define *\(' could give something.
<dokma>It's almost certainly defined in C.
<dokma>Actually, let's try and ask chatgpt.
<dokma>ChatGPT thinks it's likely in eval.c or variables.c...
<civodul>akirakyle: it's not really defined; rather it's recognized by (ice-9 psyntax), the macro expander
<haugh>this is the most upsetting sentence I've read all week
<akirakyle>civodul: Thanks! That's the file I was looking for (as you can imagine grep is pretty useless here). I'm slowly understanding parts of guile's whole compiler tower and finding it very cool! I'm glad there seems to be an intentional focus on referential transparency, reading these parts of the manual makes my head feel a bit wonky and at some point
<old>One day I won't fear to read psyntax anymore
<akirakyle>I find it's easier to just try to understand the actual implementation as much as possible
<old>akirakyle: Actually grepping Guile's source code is the most easiest way of finding definition.
<old>At the exception of `define' itself
<akirakyle>old: Yeah it's definitely one of the nice things about lisps and has helped me with everything else but this
<mfiano>akirakyle: "and at some point <message cuts off here>"
<akirakyle>mfiano: "...and at some point I find it's easier to just try to understand the actual implementation as much as possible"
<mfiano>Oh ok, sorry, I didnt know if that was part of the same sentence as it was interleaves with old's message.
<mfiano>Sorry for the noise :)
<old>I think we've hit enter in the same second
<old>hey do we have library in Guile for doing simple stats like linear/exponential interpolation?
<old>s/interpolation/fit
<lilyp>well, lerp is easily written, but I think that's about it
<old>Right. I think it could be a useful library to have.
<old>I'm using guile-charting right now for graph of benchmarks. But I would like to add fit models to it
<haugh>How do you folks approach logging? Is your approach dramatically altered by your choice of exception model?
<old>I use guile-lib
<old>It has a logging module
<old>works great
<old>For exception, I have a `catch-all` handler that simply do `(log-msg 'ERROR "Uncatched exception" key args)'
<haugh>old, thanks for the lead!
<mfiano>I couldn't sleep so I spent an hour reading wingo's blog, which I'm always happy to do. Regarding <https://wingolog.org/archives/2015/07/27/cps-soup>, which module should I be looking into if I wanted to use such persistent maps in Guile, or is this not exposed?
<ArneBab>haugh: I had a student tell me after a test when seeing the correct answer "but DaVinci AI told me a different answer". I said “that’s quite likely, but DaVinci was wrong”.
<haugh>I am so grateful that I'm not in school for this particular industrial revolution
<sneek>chrislck: Greetings :D
<ArneBab>haugh: same here — but my kids are …
<mwette>mfiano: intmap in (language cps intmap); see also intset
<chrislck>sneek: botsnack
<sneek>:)
<mwette>my shot at simple example for cps compiler: https://git.savannah.nongnu.org/cgit/nyacc.git/tree/examples/nyacc/lang/calc/compiler.scm
<yarl>Hello guile.
<yarl>Not possible to use "(getsockopt port SOL_SOCKET SO_PEERCRED)"?
<mfiano>mwette: Thanks!
<mfiano>Are these implemented with HAMT by chance?
<mwette>I believe so, IIRC.
<mwette>I don't remember if intsets use vhashes from Guile or not. And trasients, like https://clojure.org/reference/transients
<mfiano>I'm not familiar with transients. I'll read, thanks.
<mwette>transients: you create mutable data structure in narrow scope to initialize, then declare it immutable for further use
<KarlJoad>I am working on building an application that will manage a database of PDF files and associated information. I have decided on SQLite, as that is what Calibre uses. Is guile-sqlite3 the library I should use? I should
<KarlJoad>Also, is there a way to mark unimplemented functions/procedures so if I try to call them, I get some kind of message?
<ft>guile -c '(unimplemented-thing)' → Unbound variable: unimplemented-thing
<KarlJoad>Fair. Perhaps that is the better way to do it. I guess I meant what if I left a stub/prototype for the procedure, without a real implementation.
<rekado>you can define a procedure that raises a condition.
<ft>(throw 'implement-me!) :)
<KarlJoad>That works! thanks!
<old>KarlJoad: I do this for FFI: https://git.sr.ht/~old/libpatch/tree/master/item/libpatch/interface.scm
<old>I can select a backend, e.g. Sqlite3 or mysql in your case, at runtime
<old>when no backend is selected, a default stub throw an exception with the procedure name