IRC channel logs

2021-07-24.log

back to list of logs

<ArneBab>guix environment --ad-hoc --pure guile guile-wisp mercurial wget bash coreutils grep findutils -- bash -c 'mkdir -p /tmp/eval-r7rs/; cd /tmp/eval-r7rs/; wget https://ecraven.github.io/r7rs-benchmarks/all.csv; hg clone --insecure http://hg.sr.ht/~arnebab/wisp; cd wisp/examples; for i in $(cat ../../all.csv | cut -d , -f 1 | grep \- | sort -u) s7; do ./evaluate-r7rs-benchmark.w ../../all.csv $i 2>/dev/null | tail -n 1 | xargs -i echo {} : $i
<ArneBab>; done | sort -h; echo'
<ArneBab>Selected results (@wingo): geometric mean of the slowdown compared no the fastest:
<ArneBab>2.0422404109744514 (55 / 55) : chez-9.5.5-m64
<ArneBab>2.5547753475864643 (54 / 54) : gambitc-v4.9.3
<ArneBab>3.5151544897906812 (54 / 54) : racket-8.1/r7rs
<ArneBab>7.337436782525677 (53 / 53) : guile-3.0.5
<ArneBab>18.215092108261047 (53 / 53) : guile-2.2.7
<ArneBab>43.26455011006094 (45 / 45) : kawa-3.1.1
***chris2 is now known as Guest6084
<iskarian>Hey #guile, which of these two definitions reads more clearly? https://paste.debian.net/1205437
<RhodiumToad>not sure I like either
<RhodiumToad>you want to find all toplevel names which are referenced but never defined or set?
<iskarian>RhodiumToad: Yes, exactly
<RhodiumToad>is the expression likely to be large or small, or is that not known?
<iskarian>I would expect a few hundred lines at most; it's intended to be used on Guix package definitions
<iskarian>I don't expect there to be all that many unique toplevel refs, though
***chris2 is now known as Guest3926
***ecraven- is now known as ecraven
<Guest3926> ~/nick chrislck
<Guest3926>~/nick chrislck
***Guest3926 is now known as chrislck
<RhodiumToad>iskarian: how about one of these, depending on whether or not you like multiple values: https://dpaste.org/41yu
<iskarian>ah, thanks RhodiumToad! Yeah, I considered the latter but I wanted to avoid picking through with car and cdr
<iskarian>I didn't realize there was a way to use tree-il-fold with multiple values, I think that'll do
<RhodiumToad>(lambda (_ defs refs) (values defs refs)) <-- names are backwards there, harmless error but should be fixed
<RhodiumToad>or there's this one: https://dpaste.org/Y88r
<RhodiumToad>which uses match-lambda* to eliminate most of the cars/cdrs from the non-multiple-values version
<iskarian>oh, that's nice!
<avp>Hello Guilers! Is there any ORM for GNU Guile?
<avp>(ORM stands for "Object–relational mapping")
<avp>I want to use a database with GNU Guile 3.0. Currently I'm looking through "Databases" section of "Awesome Guile" list (https://notabug.org/ZelphirKaltstahl/awesome-guile/).
<avp> There's Guile-PG that has nice API and I even tried it some time ago, but it doesn't work with Guile 2.2/3.0.
<avp>And Guile-PG is not an ORM.
<avp> https://notabug.org/cwebber/guile-squee/ is not an ORM either, but at least it uses FFI and seems to be compatible with newest Guile. It would be nice if Guile-Squee had a proper build system though.
<cwebber>avp: I don't think there's a full ORM, there was another project called guile-dbi
<cwebber>I remember having some trouble with it though
<cwebber>avp: there's also the sqlite ffi thing
<cwebber>guile-sqlite3
<cwebber>not packaged for guix yet for some reason
<cwebber>but I remember liking it
<cwebber>and it inspired me to work on guile-squee all the way back when I started the package (I don't actively work on it right now)
<cwebber>cbaines has been maintiaining mostly
<avp>I see, but SQLite does not work well in multi-threaded applications.
<cwebber>is that true?
<cwebber> https://www.sqlite.org/threadsafe.html
<avp>Oh. My bad, looks like my SQLite knowledge is outdated a bit: 'serialized' mode seems to allow safe concurent access to a database.
<avp>I read some time ago that SQLite turns into a performance bottleneck if accessed from several threads in an applciation as it blocks other threads when a single thread works with a DB.
<leoprikler>that's probably what serialized implies though
<leoprikler>or maybe that's multi-thread, dunno
<leoprikler>I doubt sqlite writes in parallel, which other SQLs can do
<avp>"SQLite supports an unlimited number of simultaneous readers, but it will only allow one writer at any instant in time." -- https://www.sqlite.org/whentouse.html
<avp>So seems that both I and cwebber were right. ;-)
***davii is now known as daviid
<vijaymarupudi>Question: I've been working on a Guile version of Scribble,
<vijaymarupudi>and I was wondering if there was a way to tell if a variable
<vijaymarupudi>is undefined in a macro? Currently I'm using `syntax-local-binding` (thank goodness this api exists!), but it seems to default to outputting 'global for undefined variables. Is there a way to avoid a runtime check with `defined?`?
<avp>I'll probably go with Guile-SQLite3 for now, but it would be nice to have Guile-ORM somewhere in the near future. ;-)
<avp>I think it's important for a language to have well-written and easy-to-install libraries for common tasks, if the language is going to be popular.
<cwebber>vijaymarupudi: scribble!
<cwebber>as in racket's scribble?
*cwebber wonders if postgres really *itself* does multiple writes in parallel
<cwebber>or if it's because there's an external parallel set of connections
<civodul>avp: "guix install guile-sqlite3" :-)
<civodul>seems to me there's no universal consensus that ORMs are "a good thing"
<cwebber>civodul: oh
<cwebber>guile-sqlite3 is in guile.scm :)
<cwebber>I was looking in guile-xyz.scm
<cwebber>and didn't see it
<cwebber>and was like "huh I guess it got unpackaged"
<civodul>cwebber: it's even a dependency of Guix :-)
<civodul>vijaymarupudi: did you look at Skribilo? you could become a maintainer ;-)
<avp>civodul: I must admit that I'm not very familiar with "are ORMs are good thing" debates and would love to read something on the topic. I just think that they are pretty convenient in some other languages.
<leoprikler>I think ORMs are somewhat non-functional, inherently.
<leoprikler>What with all of their side effects :)
<avp>leoprikler: Oh, in that sense ORMs don't go well with purely functional programs indeed.
<leoprikler>That said, I think you can build your own ORM on top of guile-sqlite3 (or any other database bindings) in two ways:
<leoprikler>1. have "handles" simply be the restrictions to get you to where you want and never keep local data in records
<leoprikler>2. make records, that (with syntactic sugar) update the database whenever you set! them from the outside (with an additional invalidate! method when your caches go ouch)
<vijaymarupudi>cwebber: Yep, well, some hybrid between that and pollen :)
<vijaymarupudi>civodul: I am aware of it! It looks really cool
<vijaymarupudi>I didn't want the syntax to be so scheme heavy though (assuming the example here is still accurate): https://www.nongnu.org/skribilo/index.html#example
<leoprikler>if you're very fancy you could try using GOOPS' virtual fields
<leoprikler>for a reference where something similar is done, guile-json has json mappings, which translate to scheme records IIUC, but they aren't database-backed obviously
<civodul>vijaymarupudi: there are several frontends ("readers") and it wouldn't be hard to add one with a Texinfo/Scribble kind of syntax
<civodul>or commonmark
<vijaymarupudi>civodul: Took a deeper dive into the documentation
<vijaymarupudi>When defining a custom reader, is there a way to pass in more options?
<vijaymarupudi>I want the paragraph breaking algorithm to be customizable, for the entire document and per element
<vijaymarupudi>Currently it seems to just take the port
<civodul>vijaymarupudi: paragraph breaking is left to the backend
<civodul>for HTML, the browser takes care of it
<civodul>otherwise Lout or LaTeX takes care of it
<civodul>it's not something that's part of Skribilo proper
<vijaymarupudi>I see. I feel like the AST might be a bit different from what I was thinking of, I was envisioning definitions of custom elements in the file itself, and the ability to define new indentation sensitive syntax.
<vijaymarupudi>What seems very cool to me is that I can use Skribilo like a library, specifically the engines, after all the processing has been done
<vijaymarupudi>This is a very cool project!