IRC channel logs

2024-07-18.log

back to list of logs

<ArneBab>dthompson: \o/
<rlb>Hmm, interesting, does delete-duplicates forbid just using a hash table? It talks about optionally sorting, but if you have hash tables, and are willing to pay for the ram, that's a fairly simple approach? https://srfi.schemers.org/srfi-1/srfi-1.html#delete-duplicates I'm not sure which I'd pick, depending, but was a little surprised it's not mentioned.
<rlb>(I suppose it also *is* srfi-1...)
<rlb>Oh, right, custom equality.
<shawnw>delete-duplicates also preserves order, which you don't usually get with hash tables.
<rlb>I meant wrt using the hash table to track what you've seen, only internally, during the traversal. (Just used to that approach from clj, but there, they have persistent sets built in, and only support the primary clj "equality".)
<rlb>(course they "cheat" by using a transient for the set, as you might imagine)
<rlb> https://github.com/clojure/clojure/blob/clojure-1.11.1/src/clj/clojure/core.clj#L5054 fwiw
<shawnw>Ah. I suppose you could check to see what = is and special case eq? eqv? equal? to use one. Maybe some other common equality tests too.
<rlb>...srfi hash tables do support specifying the =, but there are interactions/constraints wrt the hashing algorithm, and then I just wandered off, planning to stick with what we have when I convert it to scheme :)
<shawnw>SRFI-146 hashmaps plus SRFI-128 comparators are a nice combination, but guile doesn't ship with either one.
<shawnw>(man I'd forgotten how bad guile's built in hash table API is. You should specify the equality and hash functions when creating a table, not every time you do something with it)
<rlb>Do we have any general sense of how "cheap" call/ec is for us now? i.e. I'm wondering if a list has to be very big (how big) before I can use it to short-circuit map/filter/etc. without paying "too much".
<rlb>(Assuming fairly cheap filter/map/etc. procs.) Alternative is of course more custom looping, which is fine, but less convenient.
<flatwhatson>i think escapes are pretty cheap, but worth benchmarking if it's perf-critical
<flatwhatson>custom loops are the portable safe bet
<rlb>Thanks -- realized I was just "doing it wrong" :) i.e. there's a better approach.
<rlb>(in this case)
<rlb>dthompson: only 5 srfi-1 functions left to convert (but might ought to set this aside for a bit).
<flatwhatson>lokke on hoot will be an interesting alternative to cljs
<rlb>ACTION hides
<rlb>No idea how that might work out, but I suppose if it didn't rely on the "whole clo*s*ure compiler", that'd be notable. Though would also mean I'd need to change (or make configurable) some things like C vectors. But that's likely doable with fectors, etc.
<rlb>test-out-of-memory has been flakier than usual here lately...
<graywolf>Hello, I want to write a macro that generates top level binding. In particular, I do not really care about the name, it will be discovered later using module-map. I wonder what is good approach here. Any recommendations?
<flatwhatson>graywolf: not sure what you're asking? name suggestions?
<mwette>graywolf: are you looking for `gensym' ?
<mwette>(with datum->syntax)
<old>graywolf: Either gensym or use a common prefix + a number generator if you have public bindings that you don't want to "discover"
<old>the latter is typically something done in C
<dsmith>sneek, botsnack
<sneek>:)
<dsmith>!uptime
<sneek>I've been aware for 2 days
<sneek>This system has been up 18 weeks, 2 days, 7 hours, 28 minutes